Stop a business rule

Gaetano De Mitr
ServiceNow Employee
ServiceNow Employee

Can I stop business rule by script?

In an application How I Can skip a business rule?

2 REPLIES 2

Anurag Tripathi
Mega Patron
Mega Patron

Hi Gaetano,



You can skip all business rules in a transaction using setWorkflow(false).


If you have to skip just one BR then id suggest trying to add something in the condition of the business rule that you have to skip so that that the condition fails for your transaction and it doesn't run.


-Anurag

haseena ayesha
Kilo Guru

Hi


Gaetano,




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



Check out mark.stanger's ServiceNowGuru article - http://www.servicenowguru.com/scripting/gliderecord-query-cheat-sheet/



Look for the "setWorkflow" section.


http://wiki.servicenow.com/index.php?title=Using_Workflow_Stage_Sets#gsc.tab=0




Thanks&Regards


Haseena.


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