
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2017 08:02 AM
I have a UI action that reopens the record from a close state to an active state and sets the status back to in progress. I would also like to restart the workflow, can someone show me how that would be written?
Workflow Name = ConnectUs
Workflow sys_id = 17f8a0e46f452a00b2a0674f8e3ee4a7
UI Action Script
function worknotess(){
if (g_form.getValue('work_notes') == '') {
try {g_form.hideFieldMsg('work_notes');} catch(e) {}
g_form.setMandatory('work_notes', true);
g_form.showFieldMsg('work_notes','Work Notes are required');
}
gsftSubmit(null, g_form.getFormElement(), 'check_worknotes'); //MUST call the 'Action name' set in this UI Action
}
if (typeof window == 'undefined')
serverResolve();
function serverResolve(){
current.current_status = ('In Progress');
current.actual_completion_date = '';
current.update();
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2017 08:12 AM
Replace line new Workflow().restartWorkflow(current, true);
with new global.Workflow().restartWorkflow(current, true);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2017 08:05 AM
Hello Edwin,
Place the below line above current.current_status = 'In Progress';
new Workflow().restartWorkflow(current, true);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2017 08:11 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2017 08:12 AM
Replace line new Workflow().restartWorkflow(current, true);
with new global.Workflow().restartWorkflow(current, true);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2017 08:15 AM
Perfect - That worked exactly how I wanted it to, thank you!!