microsoft / ALAppExtensions

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

[Event Request] Codeunit 90 - Purch.-Post - OnBeforeCheckTrackingSpecification #4706

Closed rvanbekkum closed 5 years ago

rvanbekkum commented 5 years ago

Dear ALAppExtensions team,

Through this issue we would like to request event publisher OnBeforeCheckTrackingSpecification to be added to Codeunit 90 Purch.-Post with the following signature:

LOCAL [IntegrationEvent] OnBeforeCheckTrackingSpecification(PurchHeader : Record "Purchase Header";VAR TempItemPurchLine : TEMPORARY Record "Purchase Line")

with VAR parameter TempItemPurchLine.

which would be called as follows from CheckTrackingSpecification:

    local procedure CheckTrackingSpecification(PurchHeader: Record "Purchase Header"; var TempItemPurchLine: Record "Purchase Line" temporary)
    var
        ReservationEntry: Record "Reservation Entry";
        Item: Record Item;
        ItemTrackingCode: Record "Item Tracking Code";
        ItemJnlLine: Record "Item Journal Line";
        CreateReservEntry: Codeunit "Create Reserv. Entry";
        ItemTrackingManagement: Codeunit "Item Tracking Management";
        ErrorFieldCaption: Text[250];
        SignFactor: Integer;
        PurchLineQtyToHandle: Decimal;
        TrackingQtyToHandle: Decimal;
        Inbound: Boolean;
        SNRequired: Boolean;
        LotRequired: Boolean;
        SNInfoRequired: Boolean;
        LotInfoRequired: Boolean;
        CheckPurchLine: Boolean;
    begin
        // if a PurchaseLine is posted with ItemTracking then tracked quantity must be equal to posted quantity
        if not (PurchHeader."Document Type" in
                [PurchHeader."Document Type"::Order, PurchHeader."Document Type"::"Return Order"])
        then
            exit;

        OnBeforeCheckTrackingSpecification(PurchHeader,TempItemPurchLine); // << New publisher

        TrackingQtyToHandle := 0;
        ...
bc-ghost commented 5 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. We will update this issue with information about availability.

bc-ghost commented 4 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. We will update this issue with information about availability.