I’m working on creating AP invoices via the REST API. I have the invoice head and invoice detail (misc line) created. Not I’m trying to create the GL Analysis line(s), but am not having any luck.
If I send a call to the Erp.BO.APInvoiceSvc/APInvExpTGLCs endpoint I am able to create a line, without the Document Amount (DocScrExpAmt). Anyone have any idea on the correct way to create these GL lines, with their correct amounts? Thanks!
Hi Charles, I am also working on creating AP invoices via REST API but have some issues getting the AP Header created. Could you point me in the right direction to get this done. I have looked at “GetNewAPInvHedInvoice” but can’t find the right info to build the API call. Happy to look at the GL Analysis line as soon as I have the header created.
I am using the GetNewAPInvHedInvoice to create the head, then immediately following with the UpdateMaster call to actually write all of the data to the head. After that I use the APInvDtls to write the lines. Not sure if that will help.
Sorry for delay answering. I am also using the GetNewAPInvHedInvoice Method to create the head, but the returned ds dataset is an array of 2 APInvHeds. Just wondering if this is normal as in the documentation I should only receive one ds dataset back. When using the UpdateMaster it seems that it wants me to submit values for all string fields of the APInvHed database where we did not had this problem in Service Connect .
No problem, I found the problem and header created successfully. I have also been able to add lines with the correct GL Analysis lines. Let me know if you still need help and I will share more info.
Hi Wim, I’m interested in knowing how you solved the problem of the GL lines, for now I can create the lines but when they are created it omits the value of the book and the chart of accounts.
It would be very helpful for my project if you could help me
Hi Andres, Instead of using the REST API, have decided to use PowerShell script and Epicor DMT to create the lines in the Invoice. This is working perfectly for me.
Hi Wim, I tried to use the PowerShell script but I think I don’t have the correct template for the dmt, I’m using the attached template but that does not load the gl analysis line.
Hi Andres,
Instead of using the APInvExp#GLAccount, please use the following fields:
APInvExpTGLC#GLAccount,
APInvExpTGLC#SegValue1,
APInvExpTGLC#SegValue2,
APInvExpTGLC#SegValue3,
APInvExpTGLC#SegValue4,
APInvExpTGLC#SegValue5,
APInvExpTGLC#SegValue6,
APInvExpTGLC#TransAmt,
APInvExpTGLC#InvExpSeq,
APInvExpTGLC#TGLCTranNum,
These should help you getting the invoice uploaded with correct GLAccount.