Hello folks,
I am using purchAutoCreate_Sales in x++ code to create the purch orders, it works fine and creates a PO.
However need to ensure that the created PO is submitted to the workflow through the code.
Upon checking the workflow I found that type of workflow type is VendInvoiceRecordingTemplate also found this URL but cannot figure out what should I replace custinvoiceTable for my workflow.
Initially I thought it should be vendinvoiceinfotable, however looks like that is not the correct table as none of the PO created via purchAutoCreate_Sales are creating recs in that vendinvoiceinfotable even after I manually confirm the PO.
Please suggest a solution.
Thanks
Mav
There is vendor invoice journal workflow, vendor invoice workflow, vendor invoice line worklow etc. in AP module. Where do u see purchase invoice journal workflow ?
Also note, if you enable vendor invoice automation all the invoices created through Data management as pending vendor invoices submitted automatically to the workflow using process automation, you can take a look at that as well.
Hello,
Any update on this would be really helfpul.
Thanks
Mav
Its standard out of the box OOB purchase invoice journal workflow.
The workflow you are trying to submit on PO is custom created workflow or are u using standard workflow ?Is its custom then you might have to add custom method which is going to be similar to custInvoiceTable which just sets the state on the workflow on the originating table.
Hello Sukrut,
No problem, I am using VendInvoiceRecordingTemplate type workflow, which is accessible at action pane workflow of purchase order.
I am trying to replace the code from this link which is for custinvocetrans to that of purchtable.
I am NOTfacing any challenge in selecting purchtable record , only challenge I am facing is how to replace below line of code with purchtable as I am unable to find any setWorkflowState() or similar function at purchtable.
"custInvoiceTable::setWorkflowState(_custInvoiceTable.RecId, CustFreeInvoiceWFApprovalState::Submitted); "
Thanks
Mav
Sorry , I did not understand what is missing. Can you please explain which workflow you are using and what kind of challenges you have for selecting puchtable record.
Hello Sukrut,
Yes that was done.
Only thing pending is to replace below line of code with Purchtable and I coulld not find any setWorkflowState() or similar in Purctable code.
custInvoiceTable::setWorkflowState(_custInvoiceTable.RecId, CustFreeInvoiceWFApprovalState::Submitted);
Thanks
Mav
Hi Mav ,
Did you try using method activateFromWorkflowType from class workflow to submit PO to workflow? Check code below, recId parameter should be the recId of Purchtable.
//Activate the workflow
Workflow::activateFromWorkflowType(workFlowTypeStr(YourWorkflow), recId, "@AccountsPayable:VendChangeProposalSubmit_SubmittedMessage", NoYes::No);
Hello all,
Anyone any update on this would be helpful.
Hello Andre,
Any update on above would be helpful.
Thanks
Mav
André Arnaud de Cal...
291,971
Super User 2025 Season 1
Martin Dráb
230,846
Most Valuable Professional
nmaenpaa
101,156