Hi everyone 👋,
If you genuinely want to understand how to implement Auto-Posting, read this post line by line. It’s not just about the final solution — it’s about learning how to think logically when solving a problem that doesn’t have a predefined answer — where you are the one creating it.
(I have added emojis in this blog to make it more interactive.)
The Problem
Automatic posting of Intercompany General Journals in the partner company as soon as the Intercompany Journals were posted in the base company.
After searching extensively online — including forums, documentation, and even AI tools — I couldn’t find any working solution. So, I built one myself.
The Key Discovery
I found an event that triggers after Intercompany Journal Lines are inserted in the partner company — this was the breakthrough.
The event is:
👉 OnAfterCreateJournalLines
in Codeunit 427 – ICInboxOutboxMgt
This event fires every time new Intercompany Journal Lines are inserted, dimensions are mapped, and the IC Inbox Transactions are moved to “Handled” in the partner company — the perfect point to execute our auto-posting logic.
💡 The Logic
Let’s take a simple example.
Suppose your Intercompany Journal has 6 lines with these amounts:
100, -100, 200, 300, -200, -300
When the first line (100) is inserted, the total balance isn’t zero — so we skip posting.
When the second line (-100) is inserted, the total becomes 0, meaning the batch is balanced — and now we auto-post.
We continue the same pattern: only when the total balance equals zero, the batch is posted automatically.
The Foundation — Adding an Identifier
To ensure that only the relevant IC journal lines are auto-posted, we add an identifier. For this, create a new Boolean field in the Gen. Journal Line table, e.g., Auto-Posting
.
You’ll then need to pass this flag through each step of the Intercompany process until it reaches the posting event.
Here’s how:
🚀 The Auto-Posting Logic
Finally, we handle the posting itself using the event OnAfterCreateJournalLines:
And just like that — the Intercompany Journals post automatically when they’re balanced.
💥 Simple, clean, and effective.
🧠 Key Takeaway
This solution doesn’t just automate posting — it shows how understanding the event flow and data movement in Business Central can help you build solutions that don’t exist yet.
If you’ve ever struggled with Intercompany automation, I hope this helps you save hours of trial and error.
💬 Closing Note
If this helped you or sparked new ideas, leave a comment or share your approach!
Let’s keep building smarter solutions together for the BC community. 💪