Business rule appears to be running twice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2013 11:44 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2013 06:28 AM
Hi,
If your having business rule before update, make sure you have not written current.update().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2013 08:38 AM
Jaikumar,
Thanks for the suggestion - I double checked my business rule and it does not include current.update() code.
Regards,
Mary Barrett
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2014 11:21 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2014 03:10 PM
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!