The business rule was executed twice in a row

Dat Phan
Tera Guru

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?

5 REPLIES 5

@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.