Infinite loop of business rules!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2018 08:41 PM
Dear all,
Last night, I found myself reaching a point where I am writing two business rules that get triggered when 2 different fields change. But within each BR, the script will go and edit the other BR's field.
More clearly:
BR1: When Field1 changes .. in the script, it changes Field2.
BR2: When Field2 changes .. in the script, it changes Field1.
So triggering any of the 2 BRs will call the other one in an infinite loop fashion.
The two scripts eventually stopped working. But, out of curiosity, I just wanna know how ServcieNow deals with such an issue.
Thanks and best regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2018 10:04 PM
Hi Mazin,
I would suggest you to create a bool field (true/false) and use it as a flag.
Do a flag check before running the business rule, once you update the record update the flag as well.
This process will stop the infinite BR run.