The CreatorCon Call for Content is officially open! Get started here.

Business rule triggering another business rule

AnkushH
Tera Contributor

I have one business rule which is calling a script include inside it and the trigger conditions are After insert Update and few conditions but when it triggers and calls script include to creates incident in third party applications but when it triggers and calls script include and it is triggering update business rule as well.
I have used current.update() in script include to update work notes if anything fails during the transaction.
I dont know how and why. Can i use something else instead of current.update()?

3 REPLIES 3

Brad Bowman
Kilo Patron
Kilo Patron

The Business Rule running after update with the current.update() command is updating the current record, so all Update Business Rules will run (again).  If you can't move this to before Update and remove the current.update() and don't want the other rules to run again, use current.setWorkflow(false); prior to the update line.

Ankur Bawiskar
Tera Patron
Tera Patron

@AnkushH 

since you are using current.update() in your script that's what it's triggering

share your complete script here.

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Sarthak Kashyap
Tera Guru

Hi @AnkushH ,

You are using current.update() method in after BR this will recursion situition, please try to remove it and if it is very important to use then use current.setWorkFlow(false); and make the order as highest so it will run at the end of all the BR

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards,
Sarthak