microsoft / ALAppExtensions

Repository for collaboration on Microsoft AL application add-on and localization extensions for Microsoft Dynamics 365 Business Central.
MIT License
785 stars 620 forks source link

[Event Request] table 337 "Reservation Entry" - OnAfterTransferReservation #14780

Closed ajkauffmann closed 3 years ago

ajkauffmann commented 3 years ago

Please add a new event OnAfterTransferReservation in procedure TransferReservations in table 337 "Reservation Entry"

    procedure TransferReservations(var OldReservEntry: Record "Reservation Entry"; ItemNo: Code[20]; VariantCode: Code[10]; LocationCode: Code[10]; TransferAll: Boolean; TransferQty: Decimal; QtyPerUOM: Decimal; SourceType: Integer; SourceSubtype: Option; SourceID: Code[20]; SourceBatchName: Code[10]; SourceProdOrderLine: Integer; SourceRefNo: Integer)
    var
        NewReservEntry: Record "Reservation Entry";
        CreateReservEntry: Codeunit "Create Reserv. Entry";
        ReservStatus: Enum "Reservation Status";
        IsHandled: Boolean;
    begin
        ...
        if TransferAll then begin
            OldReservEntry.FindSet();
            OldReservEntry.TestField("Qty. per Unit of Measure", QtyPerUOM);
            repeat
                OldReservEntry.TestItemFields(ItemNo, VariantCode, LocationCode);

                NewReservEntry := OldReservEntry;
                NewReservEntry.SetSource(SourceType, SourceSubtype, SourceID, SourceRefNo, SourceBatchName, SourceProdOrderLine);

                NewReservEntry.UpdateActionMessageEntries(OldReservEntry);
                OnAfterTransferReservation(OldReservEntry,NewReservEntry); // <-- NEW EVENT
            until OldReservEntry.Next() = 0;
        end else
            ....
    end;

    [IntegrationEvent(false, false)]
    local procedure OnAfterTransferReservation(var OldReservEntry: Record "Reservation Entry"; var NewReservEntry: Record "Reservation Entry")
    begin
    end;
JesperSchulz commented 3 years ago

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. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.