- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2024 04:04 AM
Hi team,
I have added a runscript in a workflow which updates the state and Assigned to when the Ritm is closed complete. Now I would like to update the worknotes field to runscript and I have added a line to it. But it isnt working and not sure why.
Attached the script for reference. Any help would be much appreciated.
Thanks
Rini
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2024 10:04 AM
Hi Mark,
The script had the below line and updating it to true sorted the issue. Thanks for your help 🙂
gr.setWorkflow(false);
Kind regards
Rini
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2024 04:09 AM
Are the other fields updates as expected, and is it just the work notes not being updated, or is the entire update not running?
If it's just the work_notes: do you have these on the form? OOB they are hidden. It shouldn't matter, but you never know.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2024 04:35 AM
It doesnt update only the worknotes and this field (work_notes) is available on the form.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2024 05:02 AM
If it's just the worknotes field, try it without the number, just the string. It could be that the number can't be found and that returns nothing at all. If that does update the worknotes, check if current is available, request is the correct field and try 'number.getDisplayValue()' instead of 'number'.
You can also put logs in your script:
gs.log("REQ Number: " + current.request.number);
gs.log("Work Notes: " + gr.work_notes);
These logs will show you what the script is having as output.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2024 10:04 AM
Hi Mark,
The script had the below line and updating it to true sorted the issue. Thanks for your help 🙂
gr.setWorkflow(false);
Kind regards
Rini