How to restart the Workflow from UI action when clicking on UI button " Reopen RITM" in the RITM form ?

Burugupalli Dha
Tera Contributor

I have created a UI Action for reopening the RITM  as below 

current.state = 1;

current.stage = "waiting_for_approval";
new global.Workflow().restartWorkflow(current, true);
current.update();
action.setRedirectURL(current);

 

Reopening the RITM by clicking on the button when the state is closed complete.find_real_file.png

Once clicking on button, the state is changed to open 

find_real_file.png

When clicking on Reopen RITM button on RITM form , the workflow should restart but its not getting triggered as per its functionality such as approvals, tasks. It remains as closed complete and approvals as approved. The state is not reverting to Requested.

find_real_file.png

 

Can anyone help me out in this requirement ?

 

Regards,

Dharani.

 

 

1 REPLY 1

AnirudhKumar
Mega Sage
Mega Sage

Your code seems alright to me.

Did you try:

new Workflow().restartWorkflow(current);

 

lol, just trying without global and the parameter true.