ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Codeunit 99000830 Create Reserv. Entry - OnBeforeClearTracking

Open SchoKa opened this issue 6 years ago • 2 comments

Hello AL-Team, please add the following Publisher(s) in Codeunit 99000803 Create Reserv. Entry:

local procedure SetupSplitReservEntry(var ReservEntry: Record "Reservation Entry"; var ReservEntry2: Record "Reservation Entry")
[...]
        if NonReleasedQty <> 0 then begin
            TempTrkgSpec1.Init();
            TempTrkgSpec1.TransferFields(ReservEntry);
            TempTrkgSpec1.Validate("Quantity (Base)", NonReleasedQty);
            // >> New
            IsHandled := false;
            OnBeforeClearTracking(IsHandled,ReservEntry);
            If Not IsHandled then
            // << New
                if (TempTrkgSpec1."Source Type" <> DATABASE::"Item Ledger Entry") and
                (ReservEntry."Reservation Status" <> ReservEntry."Reservation Status"::Reservation)
                then
                    TempTrkgSpec1.ClearTracking;
            TempTrkgSpec1.Insert();
        end;
[...]
        if NonReleasedQty <> 0 then begin
            TempTrkgSpec2.Init();
            TempTrkgSpec2.TransferFields(ReservEntry2);
            TempTrkgSpec2.Validate("Quantity (Base)", NonReleasedQty);
            // >> New
            IsHandled := false;
            OnBeforeClearTracking(IsHandled,ReservEntry2);
            If Not IsHandled then
            // << New
                if (TempTrkgSpec2."Source Type" <> DATABASE::"Item Ledger Entry") and
                (ReservEntry2."Reservation Status" <> ReservEntry2."Reservation Status"::Reservation)
                then
                    TempTrkgSpec2.ClearTracking;
            TempTrkgSpec2.Insert();
        end;

        BalanceLists;
    end;

Publisher definition: IncludeSender: false GlobaVarAccess: false local procedure OnBeforeClearTracking(var IsHandled: Boolean; var NewReservEntry: Record "Reservation Entry")

SchoKa avatar Mar 04 '20 13:03 SchoKa

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 Mar 19 '20 10:03 bc-ghost

I´m sorry, but the "IsHandled" will not work as expected when not set to var. Could you please change that?

SchoKa avatar May 15 '20 09:05 SchoKa