[Extensibility Request] Add event before PmtTolPmtReconJnl in Applied Payment Entry.InclPmtDisc
Nobody has claimed this yet.
- Dominant language
- AL
- Stars
- 683
- Forks
- 459
- Avg merge
- 3d 26m
- Merged PRs (30d)
- 633
Description
Why do you need this change?
Our extension performs payment reconciliation processing as part of a larger transaction that must remain atomic.
Table 1294 "Applied Payment Entry" calculates the payment discount in the local procedure InclPmtDisc. When UseAppliedAmt is true, it calls PaymentToleranceManagement.PmtTolPmtReconJnl(BankAccReconLine). This processing can commit the database transaction.
The Payment Tolerance Management codeunit instance is local to InclPmtDisc and is not exposed through an integration event. Therefore, an extension cannot call PaymentToleranceManagement.SetSuppressCommit(true) before PmtTolPmtReconJnl is executed.
Without this extensibility point, a failure in the surrounding extension workflow can leave partially committed data. Exposing the codeunit instance would allow an extension to suppress the internal commit and retain transaction consistency, while preserving the existing standard behavior for all other scenarios.
Describe the request
Please add an IntegrationEvent in table 1294 "Applied Payment Entry", in the local procedure InclPmtDisc(UseAppliedAmt: Boolean), immediately before the call to PaymentToleranceManagement.PmtTolPmtReconJnl(BankAccReconLine).
Current Base Application code:
if UseAppliedAmt then
PaymentToleranceManagement.PmtTolPmtReconJnl(BankAccReconLine);
Requested Base Application code:
if UseAppliedAmt then begin
OnBeforeInclPmtDiscPmtTolPmtReconJnl(
Rec, BankAccReconLine, PaymentToleranceManagement);
PaymentToleranceManagement.PmtTolPmtReconJnl(BankAccReconLine);
end;
Requested publisher:
[IntegrationEvent(false, false)]
local procedure OnBeforeInclPmtDiscPmtTolPmtReconJnl(
var AppliedPaymentEntry: Record "Applied Payment Entry";
var BankAccReconLine: Record "Bank Acc. Reconciliation Line";
var PaymentToleranceManagement: Codeunit "Payment Tolerance Management")
begin
end;
The PaymentToleranceManagement parameter must be passed by var so that subscribers can configure the same codeunit instance used by the subsequent PmtTolPmtReconJnl call.
Example subscriber usage:
[EventSubscriber(
ObjectType::Table,
Database::"Applied Payment Entry",
'OnBeforeInclPmtDiscPmtTolPmtReconJnl',
'',
false,
false)]
local procedure OnBeforeInclPmtDiscPmtTolPmtReconJnl(
var AppliedPaymentEntry: Record "Applied Payment Entry";
var BankAccReconLine: Record "Bank Acc. Reconciliation Line";
var PaymentToleranceManagement: Codeunit "Payment Tolerance Management")
begin
PaymentToleranceManagement.SetSuppressCommit(true);
end;
SetSuppressCommit has the existing signature:
procedure SetSuppressCommit(NewSuppressCommit: Boolean)
This is a backward-compatible extensibility change. When no subscriber exists, Base Application behavior remains unchanged.
Provide an implementation (optional)
- I will provide the implementation for this extensibility request
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Table 1294, Applied Payment Entry, and locate the local InclPmtDisc procedure and its call to PmtTolPmtReconJnl. Check the surrounding event publisher conventions and verify the event exposes the same Payment Tolerance Management instance by var. Done means subscribers can suppress the internal commit while behavior remains unchanged without a subscriber.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100