IsHandled: Boolean;
begin
AppliedPaymentEntry.TransferFields(Rec);
BankAccReconciliationLine.Get(
AppliedPaymentEntry."Statement Type", AppliedPaymentEntry."Bank Account No.",
AppliedPaymentEntry."Statement No.", AppliedPaymentEntry."Statement Line No.");
MatchBankPayments.SetApplicationDataInCVLedgEntry(
"Account Type", "Applies-to Entry No.", BankAccReconciliationLine.GetAppliesToID());
if AmtToApply = 0 then
Error(StmtAmtIsFullyAppliedErr);
if SuggestDiscAmt then
AppliedPaymentEntry.Validate("Applies-to Entry No.")
else
AppliedPaymentEntry.Validate("Applied Amount", AmtToApply);
AppliedPaymentEntry.Insert(true);
TransferFields(AppliedPaymentEntry);
Applied := true;
UpdateRemainingAmountExclDiscount();
"Applied Amt. Incl. Discount" := "Applied Amount" - "Applied Pmt. Discount";
Modify(true);
// >>>> New Code >>>>>>>>>>>>>>>>
IsHandled := false;
OnBeforeCheckIfPostingDateIsEarlier(BankAccReconciliationLine,"Posting Date",IsHandled);
if IsHandled then
exit;
// <<<< New Code <<<<<<<<<<<<<<<<
if BankAccReconciliationLine."Transaction Date" < "Posting Date" then
Message(StrSubstNo(TransactionDateIsBeforePostingDateMsg, BankAccReconciliationLine."Transaction Date", "Posting Date"));
end;
// >>>> New Code >>>>>>>>>>>>>>>>
[IntegrationEvent(false, false)]
local procedure OnBeforeCheckIfPostingDateIsEarlier(var BankAccReconciliationLine: Record BankAccReconciliationLine: Record "Bank Acc. Reconciliation Line"; PostingDate: Date; var IsHandled: Boolean)
begin
end;
// <<<< New Code <<<<<<<<<<<<<<<<
Why do you need this change?
There are events to prevent errors in payment registration by checking whether the posting date is earlier. However, there is one message that cannot be avoided as there is no event to subscribe to.
Describe the request
We need add event in Apply procedure
Internal work item: AB#604901