- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â04-26-2022 09:53 PM
Hi Team,
I am trying to update the current record in the workflow run script. When I am trying to use current.update(), workflow giving a warning. So i have removed that line and simple set the value for a field. But the value of the field is not getting update even after the workflow is completed.
Is there any other way to update the current record in workflow? I have tried using "Set Value" activity also, it is not updating the record.
Any suggestions are helpful.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â04-27-2022 03:08 AM
Did you try updating the u_status as 4 from background script for that record just for testing?
any before update BR is blocking the update?
try this in workflow run script
current.setWorkflow(false);
current.u_status = '4';
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â04-26-2022 10:19 PM
Hi
I am using the below script:
current.u_status = '4';
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â04-27-2022 12:36 AM
Hi
Try the below line.
current.setValue('u_status','4');
Regards,
Snehangshu Sarkar
Please mark my answer as correct if it resolves your query.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â04-27-2022 02:19 AM
Hi
I have tried the script you have mentioned. Not even Updating the field.
current.setValue('u_status','4');
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â04-27-2022 03:08 AM
Did you try updating the u_status as 4 from background script for that record just for testing?
any before update BR is blocking the update?
try this in workflow run script
current.setWorkflow(false);
current.u_status = '4';
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â04-27-2022 03:36 AM
Hi
I have tested updating the record using Background script, It is getting updated through it.
And I have tried the run script you have given, it is getting updated. The issue is solved.
Thanks