The business rule was executed twice in a row
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 12:03 AM - edited 02-06-2025 12:04 AM
I have a business rule with information:
+ "When" = "after"
+ "Condition" = "Only run when user change status to "A"".
When this business rule is run, I have create a new record into the "test_function" table.
I have an UI Action to be "Test Process". When user click to the UI Action, it will change request's status to "A". Sometimes when I click on UI Actions. About 2-3 records are created. I don't know what happened.
I think there are two possible cases:
+ Case 1: double click or double submit when click the UI Action.
+ Case 2: SN transaction management automatically reimplements when a transaction fails, but the business rules of the failed transaction are still implemented.
For case 1, I will try to use GlideRecord to update a field before implementing the business rule. But when updating data with setWorkflow = false, can the update transaction be executed immediately? And that transaction is independent of the current transaction?
In case 2, I don't know if SN has that mechanism? And how to fix it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 05:34 PM
@Animesh Das2 It is very difficult to reproduce in normal case. I tried many times but got no error. Likewise in production environment it is almost impossible to reproduce the error.