
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2017 07:49 AM
I need to pause all running workflows using an UI action when the status changes to "IT Record Opened" and then resume the workflow when the status changes from "IT Record Opened". Can someone show me how this would be done. If there's another option for me to pause the workflow, I'm open to looking at those suggestions as well.
Thanks
Current UI Action
function addITnumber(){
g_form.setDisplay('it_record', true);
g_form.setMandatory('it_record', true);
if(g_form.getValue('it_record')==''){
try {g_form.hideFieldMsg('it_record');} catch(e) {}
g_form.setMandatory('it_record', true);
g_form.showFieldMsg('it_record','Enter Idea, Demand or Service Request Ticket # to proceed.');
}
gsftSubmit(null, g_form.getFormElement(), 'ITnumber');
}
//Ensure call to server-side function with no browser errors
if (typeof window == 'undefined')
serverResolve();
function serverResolve(){
current.current_status = ('IT Record Opened');
current.update();
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2017 07:53 AM
Hi Edwin,
You could run the following script to restart the workflow:
var i = new GlideRecord('table name');
if (i.get("sys_id", "record sysid"))
{
new Workflow().restartWorkflow(i,true);
i.comments='true wf restart';
i.update();
}
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2017 07:53 AM
Check about the wait for condition activity on the workflow. It would do what you are looking for. You can find multiple examples of it in the community.