setWorkflow(false) use in business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 03:33 AM
Hi
I have one scenario, where I am using setWorkflow(false).
But in my case, there is no workflow associated with the table. But I want to stop executing remaining business rules associated with it. (Because there is another business rule that can abort this cancel action) Can I use it or not? Is there is any other option to stop execution of other business rules in this case?
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 04:18 AM
Hi @Runjay Patel ,
Thank you for the reply
Then how can I stop executing the business rule in another scope. Is there any solution for it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 04:21 AM
Hi @VullankiL ,
You need to write the BR in same scop.
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 03:45 AM
if you use setWorkflow(false) then BR, flows, notifications won't trigger on record update
Now whether it has to be used or not depends on requirement.
Example: consider you want to update all incidents and add some comments from background script, you will use setWorkflow(false) to avoid subsequent BRs, notifications from triggering
but in your case since you told there is a BR which can cancel then don't use setWorkflow(false), if the BR condition doesn't satisfy it will allow update as per your defined functionality.
If the BR condition satisifies then it will stop that action as per your customer requirement
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 04:00 AM
Hi @Ankur ,
Even after using setWorkflow(false) in my business rule, it is executing another business rule (to abort cancel action). I don't want to execute it.
I am writing the current business rule for Assessment instances table (Global scope). But the updating record is in another scope (scoped). And setWorkflow(false) showing some security constraints. How can I solve it? please let me know..
Thank you,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 04:16 AM
setWorkflow(false) can only abort for same scope table and not for other.
Why not create BR on Assessment instances table (Global scope) in your scope and then abort if required?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader