How do you cancel workflow and restart a new version on a request

curtishampton
Mega Contributor

I need to write a fix script or a simple ui action that will cancel the current workflow on an RITM record and start a new version of the same workflow.

In short, we made changes to fix the workflow for a catalog item.   Now that we have moved it to prod, we need to reset all the RITM records using the old context of the workflow so that it uses the new version of the workflow.

12 REPLIES 12

Shiraz2
Mega Guru

Workflows can be cancelled from the Workflow Context.



On the Navigation Text Bar, search for Workflows > Active Contexts. On the List View, select the Workflow you want to Cancel. go to that record and Click the UI Action Cancel.



Copy the functionality of the UI Action if you wanted to copy that UI action to other forms.



I hope this helps or guides you.


curtishampton
Mega Contributor

That handles only one portion.   I need to restart the same request under the new version of the workflow.   Is there a function that I can use to start the RITM under the new context of the workflow?   I've tried using restart.workflow() but it restarts the workflow under the outdated workflow context.


Shiraz2
Mega Guru

See if this Post can guide you: Restart / Reset Request Workflow


curtishampton
Mega Contributor

Again, this code is going to restart the version of the workflow that the RITM record was opened with.   I am trying to restart the request with the newest version of the workflow.   I've tried using the reset.workflow and it simply moves the RITM back to the beginning of the workflow that was associated to it.