- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2021 03:35 AM
Dear leaders ,
Can someone please help me with script for updating related records Description in Risk statement.
below 2 screen shots are GRC risk statement and related list have risks.
We have requirement to update all risk description if risk statement description is changed.
1>
2>
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2021 03:57 AM
you can use these steps
1) Always use after update BR on table "sn_risk_definition" to update records on another table
Condition: Description Changes
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord("sn_risk_risk");
gr.addQuery("statement", current.getUniqueValue());
gr.query();
while(gr.next()) {
gr.setValue('description', current.getValue('description'));
gr.update();
}
})(current, previous);
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
06-08-2021 05:49 AM
Thank you for sharing. Its good to get your complete library which you might have collected in last 4 years 😛
Regards,
Prasad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2021 06:41 AM
Hmm..
Sometimes we miss those possibly because the links/files get deleted over period of time.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2021 05:22 AM
Thanks Ankur.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 04:30 AM
Hi Ankur,
Why to use only After Br and not Async BR. Any particular reason for that