Notifications
Announcements
No record found.
I need to recall the transaction after submiiting so how can I do that???
I need to set the status to draft again
*This post is locked for comments
Write code to change the value of status field to draft in cancel method of workflow event handler class,
Review cancel method of TSWorkflowEventHandler class for help
PS: My assumption is that you have developed your own workflow????
yes it is customized but at the same time,i need to change the status from cancelled to draft in case of Recall;
How this can be done??can you send me code??
Canceled method in workflow event handler class
public void canceled(WorkflowEventArgs _workflowEventArgs)
{
ProjRFCTable projRFCTable;
select forupdate projRFCTable where projRFCTable.RecId == _workflowEventArgs.parmWorkflowContext().parmRecId();
if(projRFCTable.RecId && projRFCTable.ApprovalStatus !=ProjRFCApprovalStatus::rejected)
projRFCTable.ApprovalStatus = ProjRFCApprovalStatus::Draft;
projRFCTable.write();
}
Canceled method in workflow element event handler
public void canceled(WorkflowElementEventArgs _workflowElementEventArgs)
select forupdate projRFCTable where projRFCTable.RecId == _workflowElementEventArgs.parmWorkflowContext().parmRecId();
if(projRFCTable.RecId && projRFCTable.ApprovalStatus!=ProjRFCApprovalStatus::rejected)
so how I know if I pressed cancelled or recall?? there is no condition above clarifying that point??
Have you assigned CancelMenuItem to workflow type? If yes than which class it is calling, if it's default WorkflowCancelManager class than cancel method will be revoked, if you want different behavior than create your own class which should extend WorkflowCancelManager and write your code in that class. Example of this is PurchReqWFRecall class
I did typically what you mentioned but I found out workflow unrecoverable and this means that the workflow won't start over ..any suggestions plz???
plz somebody help me
What was the error you recieved in workflow along with the "unrecoverable" state? Basically you should create a CancelledEventHandler event and link it to your WorkflowType AOT element. In this event handler you can set your document state back to draft.
Can you also state what you have done and paste any applicable code here.
I did but at the same time,the workflow wont start again ;it brings back with unrecoverable workflow
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2