How to stop flow designer from business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2021 10:28 PM
Hi,
I want to stop flow designer from the Business rule. We have a requirement to copy the state of SCTASK on the RITM. In some catalog items there are more than 1 SCTASKs. I write the below business rule on after , state changes to closed incomplete or state changes to closed skipped
var gr = new GlideRecord('sc_req_item');
gr.get(current.request_item);
//gr.addQuery('sys_id', current.parent);
gr.state = current.state;
gr.stage = 'Request Cancelled';
//gr.setWorkflow(false);
gr.update();
But because of OOTB br(cancel flow on request cancelled) all the sctasks are changing to closed Incomplete.
Please help in this.
Many thanks!!
Saloni
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2021 11:36 PM
Hi,
what do you mean by all flow?
your OOB or defined flows will run based on flow trigger condition
when RITM is updated not all flows in instance will run right
Regards
Ankur
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-05-2021 11:55 PM
When STASK is incomplete and skipped RITM state will skipped or incomplete. But in my case all if there are 2 sctasks created one after one, if im changing sctsk state to closed complete and other as closed incomplete then the previous sctask is also changed to closed incomplete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2021 12:07 AM
the update is triggering this OOTB br(cancel flow on request cancelled)
Then setWorkflow(false) should stop this BR from executing with RITM gets updated
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-06-2021 12:16 AM
setWorkflow(false) is not working. I am not sure what to do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2021 12:26 AM
Hi,
setWorkflow(false) should stop the BRs from executing
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader