Business Rule not triggering on Insert, but working on Update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 09:46 PM
Trying to update field on task on insertion but it is working only on update.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 10:06 PM
Hi @David Boom,
If this BR is working on update but not on insert then this might be due to the perticular field value not available until after the record is inserted into the table.
So using before BR will not help in this case, for this you can use After BR using Gliderecord on the same table to use "obj.update()" this helps to avoid recursion risk.
var gr=new GlideRecord("sn_grc_indicator_task");
if (gr.get(current.sys_id)) { // Fetch the current record
var gm=gr.indiactor.entity.name;
gr.u_entity_name=gm;
gr.update(); // No recursion risk }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 10:13 PM
Hello @David Boom
Your business rule should be run after insert/update and in the script section, you just have to add a current.update() after 3rd line in your script
If my response helped, please mark it as helpful
thank you!
Thank You!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 10:28 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 10:35 PM
Can you give the updated script?
thanks!
Thank You!