
Hi All,
I am customizing General Journal posting in Microsoft Dynamics 365 Business Central to automatically create and apply Retained VAT and Retained IRIS entries.
What I'm doing?
> I subscribe to OnBeforePostGenJnlLine to:
Create retained VAT and retained IRIS journal lines
Pass the original Applies-to Doc. No.
> I subscribe to OnAfterPostGenJnlLine to:
Apply the posted payment entries to the original invoice using
VendEntry-Apply Posted Entries
Problem
It seems that:
OnAfterPostGenJnlLine is triggered per posted journal line
The retained lines do not carry forward the original Applies-to Doc. No. automatically,
I had tried by storing it into variable and creating dictionary as well still it doesn't stores data.
Questions
Is OnAfterPostGenJnlLine the correct event to apply retained VAT / IRIS entries?
How can I reliably preserve or retrieve the original Applies-to Doc. No. for retained entries?
Any guidance or best-practice approach would be appreciated.
Hi, good day
I hope this can help you, and give you some hints.
Events discoverability - Business Central | Microsoft Learn
Best Regards
Gerardo