Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Can you turn off the BR's while running a background script?

randrews
Tera Guru

I need to make a lot of changes to a table after moving it under the task table... is there a command you can put at the top of a background script to make it not run the business rules during the updates?

I would rather not have to disable them all.. then re-enable them all

1 ACCEPTED SOLUTION

Jim Coyne
Kilo Patron

You can use "gr.setWorkflow(false);" in your script to disable Business Rules.



Check out Mark Stanger (Crossfuze)'s ServiceNowGuru article - http://www.servicenowguru.com/scripting/gliderecord-query-cheat-sheet/



Look for the "setWorkflow" section.


View solution in original post

3 REPLIES 3

Jim Coyne
Kilo Patron

You can use "gr.setWorkflow(false);" in your script to disable Business Rules.



Check out Mark Stanger (Crossfuze)'s ServiceNowGuru article - http://www.servicenowguru.com/scripting/gliderecord-query-cheat-sheet/



Look for the "setWorkflow" section.


The "autoSysFields" is a very useful feature as well.


Thanks that will help a TON!! i am toying with this in my sandbox before i do it in dev so i can then update all client scripts/br's and policies for the push to prod.. have a week or so to work on it.. but a bit of a pain!