- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2019 10:34 AM
Hi,
I'm trying to restart a workflow running on a custom table to restart from background script. Workflow restart function call accepts current object of type GlideRecord but the challenge is how to call the current object in background script.
Could someone share any pointers on this.
Thanks.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2019 10:38 AM
Here is an example script
var gr = new GlideRecord("change_request");
gr.addQuery("sys_id", "fbeb1a480fd76b40e1f30dbce1050e42");
gr.query();
if (gr.next()) {
new Workflow().restartWorkflow(gr);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2019 10:38 AM
Here is an example script
var gr = new GlideRecord("change_request");
gr.addQuery("sys_id", "fbeb1a480fd76b40e1f30dbce1050e42");
gr.query();
if (gr.next()) {
new Workflow().restartWorkflow(gr);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2019 10:39 AM
Hi,
Below is an example :
var gr = new GlideRecord('whatever_table');
if(gr.get('whatever_sys_id')){
write your wf restart code here and instead of current pass gr.
}