Stopping business rule processing on background script

tahnalos
Kilo Sage

We are attempting to retroactively update a batch of change records (about 2000) to populate a field that was developed as mandatory.   No problem there, developed a background script.

Only problem is that the script appears to be triggering business rules left, right, and center upon the update() call.   Which we don't want (one of the business rules is resetting all the approvals, a definite no-no).

Anybody have an idea on how to stop further business rule processing?   Or trigger an update without business rule processing?

Thanks

1 ACCEPTED SOLUTION

vant
Tera Expert

You want to try to add this tag to the script so that it doesn't update the Updated field, which should skip other business rules from kicking off.


gr.autoSysField(false); // so that the records don't have system updates


gr.setWorkflow(false); // so no business rules are run


View solution in original post

6 REPLIES 6

vant
Tera Expert

You want to try to add this tag to the script so that it doesn't update the Updated field, which should skip other business rules from kicking off.


gr.autoSysField(false); // so that the records don't have system updates


gr.setWorkflow(false); // so no business rules are run


Thanks Van.   Used gr.setWorkflow(false); and it worked like a charm.


akt_snow
Giga Expert

you can use setWorkflow(false) to prevent rules from firing.


anupama8
Tera Expert

Hi,



In your background script, before the update() line you should write "gr.setWorkflow(false);" It will work fine without executing the business rules.


Assuming gr is your Glide object.



PS: Hit answered, like, Helpful or Correct depending on the impact of the response.