
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2018 01:40 PM
After Business rule on the incident table running twice.
Above is the Script causing an issue and below are the results. The result shows that it has two updates.
Is there a way to make this not happen twice?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2018 02:17 PM
Thanks for the update Karthik. if you need to update the value immediately after insert then you still go ahead with what you have. Just make sure to include the line current.setWorkflow(false); before current.update();
Note: You can prevent recursive Business Rules by using the setWorkflow() method with the false parameter, current.setWorkFlow(false). This will stop Business Rules and other related functions from running on this database access. The combination of the update() and setWorkflow() methods is only recommended in special circumstances where the normal before and after guidelines mentioned above do not meet your requirements.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2018 01:45 PM
Hello Karthik,
You need to create a BEFORE business rule to update the current field and don't use current.update(); whereas an AFTER business rule is fine to insert records on target table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2018 02:08 PM
Thanks Pradeep for the immediate response.
Here is the scenario:
We have a custom field on Incident called u_add_time.
When a user tries to create an incident, he enters the mandatory fields and also the custom field(u_add_time) and submits the record.
Since the user enters value in to the custom field, a record needs to be created in target table and after record inserts in target table the custom field on the Incident table should be empty.
As per your suggestion I used two BR's for insert and update. It didn't worked.
After (insert,update)
Before (insert, update)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2018 02:17 PM
Thanks for the update Karthik. if you need to update the value immediately after insert then you still go ahead with what you have. Just make sure to include the line current.setWorkflow(false); before current.update();
Note: You can prevent recursive Business Rules by using the setWorkflow() method with the false parameter, current.setWorkFlow(false). This will stop Business Rules and other related functions from running on this database access. The combination of the update() and setWorkflow() methods is only recommended in special circumstances where the normal before and after guidelines mentioned above do not meet your requirements.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2018 02:37 PM
Thanks Pradeep. It worked. But while testing I found another issue. There is a field on the Incident table "sys_mod_count"(OOB field). When I first added the value in custom field (u_add_time) and save the record, the sys_mod_count shows one update. But when I update the value in the custom field and update the record the sys_mod_count shows as 3 updates. I am wondering what makes this update to become double?