Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

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!