Before insert/update BR is updating the record after insert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2019 03:03 AM
Hi All,
I have a before insert/update BR that is populating a few fields based on service offering or company depending on what is provided. This has been working fine for a long time.
I've been building a REST integration and i have an after insert/update BR set to send the outbound REST messages. I also have a field on the form that increments by 1 when the form is inserted or updated. When a record is inserted via REST and the service is included, the business rule i have built to sent the outbound REST is being triggered twice, once where the current.operation() is insert and the event counter is 1 and again when the current.operation() is update and the event counter is 2.
I've confirmed that my before insert/update BR is responsible by disabling it and retesting but i don't understand why a before insert/update BR is causing the form to update after it has been inserted. I'm not using current.update(), there's nothing in there that is updating other tables that might in turn update the incident so i don't know why it's doing what it's doing!
Any thoughts?
Cheers
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2019 03:19 AM
Hi David,
Did you try enabling debug business rule and check which all BRs are triggering?
From where you are updating the counter value? Counter getting incremented is an update operation. from where it is being incremented?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2019 06:03 AM
i know which rule is triggering it.
The counter is being incremented in a before insert and update business rule.
I have a few log line in the after BR saying what the current operation is and what the event counter is. In my logs i get 2 copies of these messages on insert of record. The first says the operation is insert at the counter is 1 the second says the operation is update and the counter is 2.