- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2020 03:09 PM
Hello,
I am trying to add some work notes on an existing RITM using script (below). I am able to see the record on sys_journal_filed table but doesn't show up on RITM. What am I missing? Please advise.
Thanks,
Rajan
var grJrnl = new GlideRecord('sys_journal_field');
grJrnl.setValue('name','sc_req_item');
grJrnl.setValue('value','Testing....Again');
grJrnl.setValue('element','work_notes');
grJrnl.setValue('element_id','sys_id of RITM');
grJrnl.insert();
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2020 03:20 PM
Hello,
I'm unsure where this script is at (like business rule or what) or why you're gliding to journal_field table...but you can simply do:
variable.work_notes = "Text here";
or whatever variable holds your record and do work_notes after it.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2020 03:20 PM
Hello,
I'm unsure where this script is at (like business rule or what) or why you're gliding to journal_field table...but you can simply do:
variable.work_notes = "Text here";
or whatever variable holds your record and do work_notes after it.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2020 03:29 PM
Hi Allen,
We have some RITMs which are still in open condition due to WF failed, and need to be reworked, so that's why we have to run like a script background or Fixed script. (Just one time deal)
Thanks,
Rajan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2020 04:03 PM
Never mind Allen,
I got it working.
I added the work note variable value directly onto RITM as you suggested, and that worked fine.
Thanks,
Rajan
var rec = new GlideRecord ('sc_req_item');
rec.addQuery('sys_id','<sys_id>);
rec.query();
if(rec.next())
rec.work_notes = "Text here";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2020 05:08 PM
Hi there,
I think you can simply write the client script for this.
g_form.setValue('work_notes',"Testing");
This will simply work.
Mark it as correct/helpful, if applicable.
Regards,
Ishita Shrivastava.