Update table business rule delete
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2022 03:47 AM
I need to update a field in a table only when all the records in another table with a specific field type have been deleted. I am using a Business rule with the "Delete" on when to run.
my business rule script:
var user = current.u_userid;
var product = current.u_product; <----- need to check this field
var arr[];
var gr = new gliderecord('sys_user');
gr.addquery('sys_id', user);
gr.query();
if(gr.next()){
gr.setvalue('myfield', true);
gr.update();
}
Thanks
Labels:
- Labels:
-
Scripting and Coding
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2022 04:02 AM
Hi,
please make the BR as before delete.
Try to debug by adding gs.info() statements.
Regards
Ankur
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader