how to disable all rules, scripts, email notifications on sc_req_item

dennisandrison
Kilo Expert

HI All,

 

Does anyone know how to disable all BR, scripts, workflows, email notifications, etc on the sc_req_item table?  I have a background script that I need to run that will update values on 124 records in teh sc_req_item table and I do not want any rules or events or anything  to fire when I update.  

4 REPLIES 4

Allen Andreas
Administrator
Administrator

This at least turns off BRs, even from workflows/events, etc.

gr.setWorkflow(false);

This won't update system fields:

gr.autoSysFields(false);


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

dennisandrison
Kilo Expert

thanks 

Hi,

No problem!

Please mark original reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Paul Curwen
Giga Sage

You can use: setUseEngines(false)

 

e.g. gr.setUseEngines(false)

 

This will stop everything mentioned, be careful though as sometimes you will was Business Rules etc to run  depending on your business requirements. This also stops Data Policies from running so use it with care. 

 

Documentation link ( with a very poor explanation of 'engines') https://developer.servicenow.com/dev.do#!/reference/api/utah/server_legacy/c_GlideRecordAPI#r_GlideR...

***If Correct/Helpful please take time mark as Correct/Helpful. It is much appreciated.***

Regards

Paul