
- 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:51 AM
Hi Edwin,
What do you mean by Pausing the workflow,
What you can simply do is add a 'wait for condition' activity in the workflow and that condition happens only onclick of a button or whatever you want, this way you can easily hold the workflow from moving forward. Is this what you want to achieve?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2017 09:55 AM
hi Anurag,
I'm trying to do the same thing but having issues as well.
i want to stop the change order workflow from moving to "complete" status until all change tasks are complete. i tried adding a 'wait for cond' box and a 'set value' to pending box but nothing works. the order still goes to complete when user moves it. what am i doing wrong or what is the format i should be using?
thx
Khaled

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2017 07:52 AM
Hi Edwin,
Do you want to pause the workflow at any particular step?
If Yes, then you can add a wait for condition on that particular step.
But if you want to pause any stage of workflow, you will have to put wait condition always. Thats difficult
Please mark this response as correct or helpful if it assisted you with your question.

- 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