Does anyone here have an example of how to run the AP Invoice Posting process thru code? We have a need to upload AP Invoices coming from outside and post them automatically, and I haven’t run across anything yet to do it. Any help would be greatly appreciatedd!
Just in case no one has any examples to share, you should be able to trace and get all the
information you need. (Probably more than you need )
We did this through a function (although this hasn’t been fully testing and still hasn’t been moved to our production environment). The flow I created is as follows:
- Set your function to have an input variable for the GroupID.
- Create a APInvoicePostTableset variable.
- APInvGrp.PrePostGroupInvoices
- APInvoice.CheckGroupTaxID
- APInvoicePost.GetNewParameters
- Set the GroupID of the Tableset to the GroupID input parameter.
- Set the AgentID of the Tableset to “SystemTaskAgent”.
- APInvoicePost.SubmitToAgent
We also have another function which we use to create a list of groups that meet certain criteria and then run the previous function on that list of groups.
Like I said this hasn’t been fully tested and some of it may not work or may be unnecessary.
Thanks for the info, @Ross.Fireball.Kuiper! I might need to do this outside of Epicor,as I’ll need to trigger the process after creating an AP Invoice batch from files we’re downloading. I’ll take a further look at following this suggestion, maybe triggering an Epicor Function from outside of Epicor through a REST call?
It’s what the cool kids do.
@Ross.Fireball.Kuiper, could I ask you to post the Function here? I am brand new to writing them, although I’ve written BPMs in 8/9/10…
I have it set up like a BPM although you can choose for it to be just code as well.
You can see for some of the business objects I ignored a lot of the outputs, you can use those for error handling and such, but we haven’t implemented that for now.
Hi John. I have the same need for my company. Did Ross’s solution work for you or did you go another way?
Gerardo, we ended up creating a Function that calls the Post method with just the GroupID after creating the batch throuigh DMT. I would recommend a different approach, as the DMT process takes a while to execute for the different templates we’re using.
John, thank you for your reply! What do you mean be a different approach? We are also setting up DMT to upload invoices and payment data from outside into Kinetic, and my manager tasked me with creating the function to post the invoices. Can you share some screenshots of your function?
I see a lot of this. Why don’t y’all either make, or have made, a program (function) and screen that uploads a file and does this for you?