最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

AX 2012将自由文本发票(FTI)提交给工作流程的实用程序代码 / Utility code for submitting the Free text invoice (FTI) to wokflow using code AX 2012

网络文摘 William 1919浏览 0评论
Hi Guys This post targeting developers and help them submitting the document like free text invoice to workflow automatically using code.
 static void WorkflowAutoSubmit(Args _args)  
 {  
   WorkflowVersionTable  workflowVersionTable;  
   custInvoiceTable _custInvoiceTable;  
   boolean submited = true;  
   workflowVersionTable = Workflow::findWorkflowConfigToActivateForType(  
                       workFlowTypeStr(CustFreeTextInvoiceTemplate),  
                       _custInvoiceTable.RecId,  
                       _custInvoiceTable.TableId);  
   if (_custInvoiceTable.RecId  
   && workflowVersionTable.RecId  
   && _custInvoiceTable.WorkflowApprovalState == CustFreeInvoiceWFApprovalState::NotSubmitted)  
   {  
     // submitting to workflow; if auto workflow submission is required on journal.  
     Workflow::activateFromWorkflowType(  
             workFlowTypeStr(CustFreeTextInvoiceTemplate),  
             _custInvoiceTable.RecId,  
             "auto submit to workflow",  
             false,  
             curUserid());  
     custInvoiceTable::setWorkflowState(_custInvoiceTable.RecId, CustFreeInvoiceWFApprovalState::Submitted);  
     info("invoice submitted to workflow");  
   }  
   else  
   {  
     submited = false;  
   }  
 }  
Thanks Happy Daxing ?
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny