How do you reset the workflow status of a purchase requisition from completed to submitted programatically in X++?

送分小仙女□ 提交于 2019-12-11 00:52:41

问题


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.


回答1:


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

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




回答2:


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);


来源:https://stackoverflow.com/questions/634478/how-do-you-reset-the-workflow-status-of-a-purchase-requisition-from-completed-to

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!