How to stop flow designer from business rule

Saloni9
Giga Contributor

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

15 REPLIES 15

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

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

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

setWorkflow(false) is not working. I am not sure what to do.

Hi,

setWorkflow(false) should stop the BRs from executing

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader