Business rule appears to be running twice

mbarr
Kilo Explorer

I am working on a business rule (on insert or change, executed before) that determines whether an Overtime/Time Off Request can be submitted based on the pay period covered in the Request and the current day's Pay Period information. The business rule is functioning correctly, but it appears to be executing twice. I have a log of gs.addInfoMessage statements still active for debug purposes and by their display I can trace the execution through the script twice.

Has anyone had this experience and is there something I could/should do to only execute the script once?

9 REPLIES 9

User166992
Tera Guru

Hi,

If your having business rule before update, make sure you have not written current.update().


mbarr
Kilo Explorer

Jaikumar,

Thanks for the suggestion - I double checked my business rule and it does not include current.update() code.

Regards,

Mary Barrett


felipe_barbosa
ServiceNow Employee
ServiceNow Employee

I'm having the very same issue, let me know if you reached a solution by now. (I know this thread is old, sorry for necroing it).



Cheers!



Felipe


felipe_barbosa
ServiceNow Employee
ServiceNow Employee

I have done some things that solved my issue:



1st. Changed the order to a high number, i.e.: 11000 (this will ensure low concurrence to the execution of your script and it won ´t be bothered by another business rule)



2nd. My condition was current.state == "value", changed it to current.state.changes() && current.state == "value"



My business rule is async, but this should apply to any other option of when running the BR.



I hope it helps who may check on this thread... Cheers!