Quantcast
Viewing all articles
Browse latest Browse all 10657

Utility code for submitting the Free text invoice (FTI) to wokflow using code AX 2012

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 Image may be NSFW.
Clik here to view.

Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 10657

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>