As we know, as part of a touchless Accounts payable invoicing process, an imported invoice can automatically be submitted to the workflow system.Once it is submitted to workflow you can configure series of process automation jobs to match product receipts to the invoice and Post the invoice. As part of this process, you can specify the maximum number of times that the system should try to match product receipts to an invoice line before it concludes that the process failed.

This process works great for invoices imported through data management or using package API using the following entities.

  1. Vendor Invoice Header
  2. Vendor Invoice Line
  3. Vendor Invoice Document attachment

More information about vendor invoice automation can be found in the following doc’s article.

https://learn.microsoft.com/en-us/dynamics365/finance/accounts-payable/auto-vendr-invc-process

Sometimes in our implementation scenarios we import invoices using custom services. If you are using an invoice automation feature which is provided out of the box, invoices created using custom services don’t follow automation. When I say don’t follow automation that means if you have workflow enabled to submit these invoices to start the automation, they fail to submit in the automation.

In your custom services code which inserts data in vendInvoiceInfoTable, you can include following code so that whenever pending invoice created in the F&O it will be automatically picked up by workflow for invoice automation.

Thank you for reading the post. I will share the code to create pending invoices in F&O on my github page.