Extensibility
Advanced Bank Reconciliation exposes integration events and procedures that other apps can use to extend matching, background processing, reconciliation-line behavior, transfer, and posting. This page lists all integration events published by the main app.
Subscribe to an event by using the event name and publisher object shown below.
Automatic Matching
These events let you intercept matching decisions and adjust how a reconciliation line or matching rule is processed.
| Event | Publisher | Purpose |
|---|---|---|
OnBeforeMatchReconLine | ReconcilePayments_APR_TSL | Runs before a reconciliation line is matched. Set Handled to prevent the standard matching process. |
OnAfterApplyAutoMatchRuleFilters | ReconcilePayments_APR_TSL | Runs after the matching-rule filters are applied. Use it to adjust the record filter or take over the matching operation. |
OnBeforeClearLineMatch | ReconcilePayments_APR_TSL | Runs before existing matches are cleared from a reconciliation line. Set Handled to replace the standard behavior. |
Background Matching
These events cover checks, execution, completion, and cleanup for automatic matching that runs in the background.
| Event | Publisher | Purpose |
|---|---|---|
OnBeforeDoChecksBeforeRunAutoMach | PmtAutoMtchYesNo_APR_TSL | Runs before the checks that precede automatic matching. |
OnAfterDoChecksBeforeRunAutoMach | PmtAutoMtchYesNo_APR_TSL | Runs after the pre-run checks and before the background matching task is started. |
OnBeforeRunAutoMatch | PmtAutoMtchBckgrndRun_APR_TSL | Runs before a scheduled background matching task starts. |
OnAfterRunAutoMatch | PmtAutoMtchBckgrndRun_APR_TSL | Runs after a background matching task completes successfully. |
OnBeforeCleanUpAutoMachBackgroundTable | ScheduledAutoMatch_APR_TSL | Runs before scheduled background matching records are deleted for a reconciliation. |
Reconciliation Line Behavior
These events allow an extension to customize line styling, applied-document text, allocation handling, and dimension confirmation.
| Event | Publisher | Purpose |
|---|---|---|
OnBeforeGetLineStyleText2_APR_TSL | BankAccReconLine table extension | Runs before the line style and applied-amount style are calculated. |
OnBeforeGetAppliedDocNoText2_APR_TSL | BankAccReconLine table extension | Runs before the applied-document numbers text is calculated. |
OnBeforeCheckAndInsertAllocation2_APR_TSL | BankAccReconLine table extension | Runs before an allocation is checked and inserted. |
OnBeforeAskConfirmationToUpdateAllLineDim_APR_TSL | BankAccReconLine table extension | Runs before the confirmation to update dimensions on all reconciliation lines is shown. |
Transfer and Posting
These events let extensions modify or replace the transfer of reconciliation lines to the General Journal and the posting of customer or vendor entries.
| Event | Publisher | Purpose |
|---|---|---|
OnBeforeAfterGetBankAccReconciliationLineRecord | TransBankRectoGenJnl_APR_TSL | Runs before the report processes a bank reconciliation line. |
OnBeforeTransferGJL | TransBankRectoGenJnl_APR_TSL | Runs before a General Journal line is created from a reconciliation line. Set IsHandled to replace the standard transfer. |
OnAfterTransferGJL | TransBankRectoGenJnl_APR_TSL | Runs after a General Journal line has been created from a reconciliation line. |
OnBeforePostEntries | TrfCustVendEntries_APR_TSL | Runs before customer or vendor entries are posted during transfer. Set IsHandled to replace the standard posting. |
Overriding Transfer to Journal Defaults
The Transfer Bank Recon to General Journal report (TransBankRectoGenJnl_APR_TSL, ID 70254115) is the processing report used by the Transfer to Journal action. By default, it works out which Gen. Journal Template, Gen. Journal Batch, and automatic posting setting to use from the Payment Reconciliation Setup and, if configured, the Bank Account card.
If your app runs this report programmatically - for example to automate the transfer to journal step after an import - you can override any of these defaults before running the report using the following exposed procedures.
SetBankAccRecon
procedure SetBankAccRecon(var UseBankAccReconciliation: Record "Bank Acc. Reconciliation")
Sets the bank account reconciliation whose statement lines are transferred, and resets the Gen. Journal Template, Gen. Journal Batch, and automatic posting option back to the defaults from the Payment Reconciliation Setup. Call this first, before any of the overrides below, since it will reset values you have already set.
SetJournalTemplateAndBatch
procedure SetJournalTemplateAndBatch(GenJournalTemplateName: Code[10]; GenJournalBatchName: Code[10])
Overrides the Gen. Journal Template and Gen. Journal Batch that the transferred lines are inserted into, instead of the batch that would otherwise be defaulted from the Payment Reconciliation Setup (or Intercompany Template/Batch, if the lines being transferred are Intercompany).
SetPostAfterInsert
procedure SetPostAfterInsert(PostAfterInsertValue: Boolean)
Overrides whether the journal is posted and matched automatically once the lines have been transferred, instead of using the Auto Post Bank Journal setting from the Payment Reconciliation Setup or Bank Account card.
Example
var
BankAccReconciliation: Record "Bank Acc. Reconciliation";
TransferToGenJnl: Report TransBankRectoGenJnl_APR_TSL;
begin
BankAccReconciliation.Get(BankAccReconciliation."Statement Type"::"Bank Reconciliation", BankAccountNo, StatementNo);
TransferToGenJnl.SetBankAccRecon(BankAccReconciliation);
TransferToGenJnl.SetJournalTemplateAndBatch(GenJournalTemplateName, GenJournalBatchName);
TransferToGenJnl.SetPostAfterInsert(true);
TransferToGenJnl.Run();
end;
SetJournalTemplateAndBatch and SetPostAfterInsert are both optional - only call the ones you need to override. Anything you don't set keeps the default worked out by SetBankAccRecon.