var gr = new GlideRecord('wf_context');
gr.addQuery("id", current.sys_id);
gr.addInactiveQuery();
gr.addQuery("name","HR case placed on hold");
gr.query();
//while (gr.next()){
if (gr.next()){
/*gs.addInfoMessage(gr.active);
if (gr.active && current.state!=previous.state){
//--cancel the old workflow
gs.addInfoMessage('cancelling previous on hold workflow');
var wf = new Workflow();
wf.cancel(gr);
}*/
gs.addInfoMessage('restarting "HR case placed on hold" workflow');
var wflw = new Workflow();
wflw.startFlow(wflw.getWorkflowFromName('HR case placed on hold'), current, 'update');
//break;
}
gr.addQuery("id", current.sys_id);
gr.addInactiveQuery();
gr.addQuery("name","HR case placed on hold");
gr.query();
//while (gr.next()){
if (gr.next()){
/*gs.addInfoMessage(gr.active);
if (gr.active && current.state!=previous.state){
//--cancel the old workflow
gs.addInfoMessage('cancelling previous on hold workflow');
var wf = new Workflow();
wf.cancel(gr);
}*/
gs.addInfoMessage('restarting "HR case placed on hold" workflow');
var wflw = new Workflow();
wflw.startFlow(wflw.getWorkflowFromName('HR case placed on hold'), current, 'update');
//break;
}
Comments
Post a Comment