Cancel flow designer from a server side script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2023 08:02 AM
Hello experts,
Is there a way to cancel a flow designer flow from a server side script running on a RITM. Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2023 01:39 AM
Yes, in that table in the source, i am able to get the RITM sys_id but still it is showing me the same error. I am running it from background script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2023 01:40 AM
var now_GR = new GlideRecord("sys_flow_context");
now_GR.addQuery("source_record", "436c8d344732211092c98021336d43aa"); //Replace with the sys_id of your RITM
now_GR.query();
while (now_GR.next()) {
gs.log("to check if it exists"); // to check if record exists or not
sn_fd.FlowAPI.cancel(now_GR.getUniqueValue(), 'Canceling Test Flows');
}
I am even adding a log statement. The log statement is getting printed but i am getting that error. Dont know where the issue lies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2023 01:43 AM
Can you test a RITM which has a flow designer attached to it and run your script in the background. I think u will face the same issue.