- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
I created a client UI action that would a open new change request on press, however I noticed that if I try to set a work note during the creation - the script completely breaks and no record is created. No error is outputted either when i go to system logs.
var change = new GlideRecord("change_request");
change.initialize();
change.short_description = "Test";
change.description = "Test Description";
change.work_notes = "Test Note"; // Ticket is created if this line is commented out
change.insert();My goal is to create a work note that would be a copy of the description. I can accomplish this through a business rule, but that is overkill and I feel like I should be able to do this with one line of code in the action itself.
What's the proper way to set a work note in a UI action?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @anguyen8842
Because client side GlideRecord can only handle basic fields like strings and integers, it cannot process Journal fields like work_notes or comments. These fields require server-side processing to generate the journal entries and timestamps.
you should simply uncheck the "Client" box on your UI Action. By unchecking "Client", your script runs entirely on the server. The GlideRecord object will then have full access to the Journal field processor, and your exact code will work immediately.
Happy to help! If this resolved your issue, kindly mark it as the correct answer ✅ and Helpful 👍 and close the thread 🔒 so others can benefit too.
Warm Regards,
Deepak Sharma
Community Rising Star 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @anguyen8842
Because client side GlideRecord can only handle basic fields like strings and integers, it cannot process Journal fields like work_notes or comments. These fields require server-side processing to generate the journal entries and timestamps.
you should simply uncheck the "Client" box on your UI Action. By unchecking "Client", your script runs entirely on the server. The GlideRecord object will then have full access to the Journal field processor, and your exact code will work immediately.
Happy to help! If this resolved your issue, kindly mark it as the correct answer ✅ and Helpful 👍 and close the thread 🔒 so others can benefit too.
Warm Regards,
Deepak Sharma
Community Rising Star 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I won't recommend GlideRecord in client side as it's not best practice.
You can use GlideAjax and then it will help in setting all the fields including work_notes
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hope you are doing good.
Did my reply answer your question?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
