Stop a business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2017 03:47 AM
Can I stop business rule by script?
In an application How I Can skip a business rule?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2017 04:08 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2017 04:52 AM
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