How setworkflow method work in BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2025 02:41 AM
Hi,
I want to know how setworkflow(false) work in BR. Do we have to write after the logic or between the logic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2025 02:47 AM - edited ‎07-09-2025 02:48 AM
Hi @GofortP ,
setWorkflow(false) will stop business rules & workflows from running.
You can use it at end but before gr.insert() or gr.update() statement
Please mark correct if it is helpful to you
Thanks,
GP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2025 02:47 AM
you need to write setWorkflow(false) just before either of these lines as per your requirement gr.insert() or gr.update() or gr.query().
It will disable the business rules on that table after insert, update or during query
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
‎07-09-2025 02:56 AM
AA ....... Sasur Galat haii answer apka app samajh naahi paye
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2025 02:47 AM
Hi @GofortP
Typically, setWorkflow(false) is called before performing any database operations such as create, update, or delete. So that, it will not trigger any other workflows or business rules.
So in your BR, you can write that before the insert(), update() or delete() operation.
Regards,
Siva