Not able to insert into Journal field through Glide Record in Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 05:17 AM
Hi,
We are creating a service catalog in which we have a variable named comments that is mapped to "Journal Input" type. In the catalog client script we need to insert into the table using GlideRecord. But when i assign a value to the journal field, the script is not working. If i comment the line assigning value to Journal field, the script is working.
Below is the script.
var gr = new GlideRecord('u_requests');
gr.initialize();
gr.short_description = "Test Title";
gr.description = "Test Description";
gr.u_caller_id = "RequestedFor";
gr.cmdb_ci = "Environment";
gr.u_request_start_date = "05/16/2017";
gr.comments= "Test Comments";
//gr[comments].setJournalEntry(Comments);
gr.u_product = "Product Name";
gr.insert();
Can somebody please check my script above and correct the mistake that i am doing?
Thanks,
Venu
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 05:31 AM
comments is a journal field and you cannot do this with a client script. See my notes above about moving this logic to a server script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 05:23 AM
Just use,
gr.comments= "Test Comments";
if you add comments to journal value activity stream it will updates..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 05:30 AM
Hi Balaji,
Thanks for your reply. May you please elaborate your statement "if you add comments to journal value activity stream it will updates.."
Thanks,
Venu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2018 08:40 PM
I tried to use this post to add some text into work_notes field of incident gliderecord, before the .insert(). The only way it would work was with:
grInc['work_notes'].setJournalEntry("the text I want in the note");
Your example syntax of gr[comments] does not work because it doesn't have quotes around the field name. This was a London instance.