How do you reset the workflow status of a purchase

2019-07-10 00:23发布

MS Dynamics AX 2009:

I need to do this from the Purchase Order Screen, so I only have the Purchase Requisition number available from the PurchLines Table.

Your help would be really greatly appreciated as there is nothing yet on the net available (that I can find) and there are missing classes in the AX 2009 Tutorials.

All helpful answers will definitely get an upvote from me.

Edit: Purpose is to force the existing workflow to re-execute on the Purchase Requisition from "Submitted" stage when a button is clicked on the Purchase Order Screen.

2条回答
做个烂人
2楼-- · 2019-07-10 00:38

This will reset the workflow state and status fields in PurchReqTable, but it won't execute any workflow logic:

PurchReqTable::setWorkflowState(PurchReqTable::find(PurchLine.PurchReqId).RecId, PurchReqWorkflowState::Submitted);
查看更多
做个烂人
3楼-- · 2019-07-10 00:47

I found the answer (code) to submit it to the workflow again:

workflowCorrelationId = Workflow::activateFromWorkflowTemplate(workflowTemplateName,recId,note,NoYes::No,'userid');

查看更多
登录 后发表回答