Is there a way to stop flow designer from running

JLeong
Mega Sage

Is there a way to stop a flow designer from running?

example:

setWorkflow(false);   //Do not run business rules

autoSysFields(false);  //Do not update system fields

Thank you!

 

1 ACCEPTED SOLUTION

Hi Mark,

Yes it triggered.

Orlando Patch 7

I am not sure any additional options are available on flow properties because I couldn't find it.

Script:

var gr = new GlideRecord('incident');

gr.initialize();
gr.setWorkflow(false);
var sysId = gr.insert();

gs.info(sysId);

Flow:

find_real_file.png

Output:

find_real_file.png

find_real_file.png

Regards
Ankur

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

View solution in original post

13 REPLIES 13

Mark Roethof
Tera Patron
Tera Patron

Hi there,

setWorkflow(false) actually already prevents Flows from running. setWorkflow(false) is not intended only for Business Rules.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Did this solve your question? Or do we need to follow-up on this?

Please mark this answer as correct if it solves your question. This will help others who are looking for a similar solution. Also marking this answer as correct takes the post of the unsolved list.
Thanks.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Ankur Bawiskar
Tera Patron
Tera Patron

@JLeong 

You cannot stop flow from triggering using setWorkflow(false) since the flow engine is a scripted engine.

refer link below

Using setWorkflow(false) doesn't stop Flow Designer flows from executing?

Regards
Ankur

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

Ankur,

Did you also test this? I mean I tested this, and it does stop the Flow from triggering.

You are also referencing a topic from a year old. Since then, a lot of changes have been applied on Flow Designer. For example the change in working on the "Run Business Rules" checkbox.

Kind regards,
Mark

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn