Hi Experts,
I have a requirement in Business Central and would appreciate your guidance on the best approach.
Scenario
An external application (Third-Party App) pushes Sales Invoices into Business Central.
The invoice is created successfully in BC as an Unposted Sales Invoice.
Requirement
As soon as the invoice arrives in BC, it should be automatically posted within a few seconds.
Conditions
✅ No Post button click by the user
✅ No Job Queue
✅ No Report/Batch Processing page
✅ No manual action from users
✅ Invoice should post automatically after it is fully created
Challenge
I tried using a subscriber on Sales Header OnAfterModifyEvent and calling:
Codeunit.Run(Codeunit::"Release Sales Document", SalesHeader);
Codeunit.Run(Codeunit::"Sales-Post", SalesHeader);
but this resulted in transaction issues and errors such as:
(The record in table Sales Shipment Header already exists.)
and sometimes:
(An error occurred and the transaction is stopped.)
The reason seems to be that OnAfterModifyEvent fires multiple times while the invoice is still being created.
Question
What is the recommended Business Central approach to automatically post a Sales Invoice immediately after it is fully created by an external application, without using Job Queue or any user action?
Thanks in advance for your suggestions and best practices.

Report
All responses (
Answers (