- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2018 03:35 AM
Hi
I have one custom table and i am inserting record on the table whenever changing state is pending the Incident table
1. Once Record is created on my custom table one workflow will run on the record
2. if they changing the state form pending to active then again changing active to Pending state in incident table means another one record will insert in my custom table
in this case i want to cancel my previous record workflow
How to achieve this..?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2018 04:15 AM
Hi Ashutosh,
Can i do like this,
I have running one Before Insert BR on my custom table and running this script....
var rec = new GlideRecord('on_hold_state');
rec.addQuery('number', current.number);
rec.query();
if (rec.next()) {
var workflow = new global.Workflow();
workflow.cancel(rec);
gs.info("Existing Recors is " + rec.sys_id);
}
actually this is working but i just want to know whether this is correct method or not

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2018 04:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2018 04:15 AM
Hi Ashutosh,
Can i do like this,
I have running one Before Insert BR on my custom table and running this script....
var rec = new GlideRecord('on_hold_state');
rec.addQuery('number', current.number);
rec.query();
if (rec.next()) {
var workflow = new global.Workflow();
workflow.cancel(rec);
gs.info("Existing Recors is " + rec.sys_id);
}
actually this is working but i just want to know whether this is correct method or not
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2018 04:24 AM
I want to know it will impact other running workflow or not..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2018 05:20 AM
Hi Ramesh,
This will cancel rec workflow. No impact on other things.
Thank you