ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] PAGE 234 "Apply Employee Entries" OnBeforeEarlierPostingDateError

Open aobsgit opened this issue 6 years ago • 1 comments

trigger OnQueryClosePage(CloseAction: Action): Boolean
begin
    if CloseAction = ACTION::LookupOK then
        LookupOKOnPush;
    if ApplnType = ApplnType::"Applies-to Doc. No." then begin

OLD CODE if OK and (TempApplyingEmplLedgEntry."Posting Date" < "Posting Date") then begin

NEW CODE if OK then begin RaiseError := ApplyingCustLedgEntry."Posting Date" < "Posting Date"; OnBeforeEarlierPostingDateError(ApplyingCustLedgEntry, Rec, RaiseError, CalcType); if RaiseError then begin

            OK := false;
            Error(
              EarlierPostingDateErr, TempApplyingEmplLedgEntry."Document Type", TempApplyingEmplLedgEntry."Document No.",
              "Document Type", "Document No.");
        end;
        if OK then begin
            if "Amount to Apply" = 0 then
                "Amount to Apply" := "Remaining Amount";
            CODEUNIT.Run(CODEUNIT::"Empl. Entry-Edit", Rec);
        end;
    end;

[IntegrationEvent(false, false)] local procedure OnBeforeEarlierPostingDateError(ApplyingEmplLedgerEntry: Record "Employee Ledger Entry"; EmplLedgerEntry: Record "Employee Ledger Entry"; var RaiseError: Boolean; CalcType: Option) begin end;

aobsgit avatar Sep 30 '20 12:09 aobsgit

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. We will update this issue with information about availability.

bc-ghost avatar Oct 02 '20 06:10 bc-ghost