How to update worknotes Based on Related List Records adding/removing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 10:47 PM
Hi,
I have one requirement update the work notes whenever records added or removed in related list like service now incident table whenever under related list problem record added then work notes updated with "
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 10:56 PM
Hi @siva44 ,
Create a Business Rule
(function executeRule(current, previous /*null when inserted*/) {
var incident = new GlideRecord('incident');
if (incident.get(current.parent)) { // Ensure it's linked to an Incident
var problem = new GlideRecord('problem');
if (problem.get(current.child)) { // Ensure it's linked to a Problem
var actionText = current.operation() === 'insert' ? "added" : "removed";
var workNote = "Problem " + problem.number + " 'Parent' field " + actionText;
incident.work_notes = workNote;
incident.update();
}
}
})(current, previous);
"If you found my answer helpful, please give it a like and mark it as the accepted solution. It helps others find the solution more easily and supports the community!"
Thanks & Regards,
Barath.P
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 11:04 PM
Hi @Barath P Which table we need to create that BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 11:13 PM
@siva44
For a Business Rule (BR) to track when a Problem Record is added or removed in the Related List of an Incident, you should use the task_rel_task table
"If you found my answer helpful, please give it a like and mark it as the accepted solution. It helps others find the solution more easily and supports the community!"
Thanks & Regards,
Barath.P
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 11:20 PM
I am not abel to findout the that table in PDI