W1][Codeunit][370][Bank Acc. Reconciliation Post] New event OnPostPaymentApplicationsOnAfterSetAppliesToIDToJnlLine in PostPaymentApplications
Why do you need this change?
When posting payment applications from the Payment Reconciliation Journal, our extension needs to transfer an additional reference (advance payment no.) to the Gen. Journal Line. Without it, the reference is missing on part of the resulting G/L entries, in particular on the bank account G/L entry, so these entries can't be reconciled against the related advance payment documents.
The existing event OnPostPaymentApplicationsOnAfterInitGenJnlLine doesn't fit this need because it uses the IsHandled pattern. Other extensions subscribe to it and may handle (take over) the posting. Since the subscriber execution order isn't guaranteed, values set by another subscriber may not be applied before the line is processed. A dedicated, non-bypassing event right after the "Applies-to ID" assignment gives a reliable point to enrich the journal line before any IsHandled logic runs. Other partners can reuse it for similar scenarios.
Describe the request
GenJnlLine."Source Code" := SourceCode;
GenJnlLine."Allow Zero-Amount Posting" := true;
GenJnlLine."Applies-to ID" := BankAccReconLine.GetAppliesToID();
OnPostPaymentApplicationsOnAfterSetAppliesToID(GenJnlLine, BankAccReconLine);
if GLSetup."Journal Templ. Name Mandatory" then begin
GLSetup.TestField("Bank Acc. Recon. Template Name");
GLSetup.TestField("Bank Acc. Recon. Batch Name");
GenJnlLine."Journal Template Name" := GLSetup."Bank Acc. Recon. Template Name";
GenJnlLine."Journal Batch Name" := GLSetup."Bank Acc. Recon. Batch Name";
end;
[IntegrationEvent(false, false)] local procedure OnPostPaymentApplicationsOnAfterSetAppliesToID(var GenJournalLine: Record "Gen. Journal Line"; var BankAccReconciliationLine: Record "Bank Acc. Reconciliation Line") begin end;
Provide an implementation (optional)
- [ ] I will provide the implementation for this extensibility request
:robot: AI triage completed. Product group, please validate the triage report (Microsoft internal access only, use Ctrl+Click to open in new tab).
Was this triage helpful? React with :thumbsup: or :thumbsdown: on this comment to provide feedback.