microsoft / ALAppExtensions

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

[Event Request] Codeunit 7312 "Create Pick" - OnAfterSetQtyAvailableBaseForDirectedPutAwayAndPick #27025

Closed 1languste closed 2 months ago

1languste commented 2 months ago

Describe the request

I want to perform additional business logic after the QtyAvailableBase is calculated. Therefore, I request the following event:

local procedure CreateTempLine(
    LocationCode: Code[10]; ItemNo: Code[20]; VariantCode: Code[10]; UnitofMeasureCode: Code[10]; FromBinCode: Code[20]; ToBinCode: Code[20]; QtyPerUnitofMeasure: Decimal;
    QtyRoundingPrecision: Decimal; QtyRoundingPrecisionBase: Decimal; var TotalQtytoPick: Decimal; var TempWhseItemTrackingLine2: Record "Whse. Item Tracking Line" temporary; var TotalQtytoPickBase: Decimal;
    WhseItemTrackingSetup: Record "Item Tracking Setup")
var
    QtytoPick: Decimal;
    QtytoPickBase: Decimal;
    QtyAvailableBase: Decimal;
    IsHandled: Boolean;
    FirstBinCode: Code[20];
begin
    GetLocation(LocationCode);
    if CurrLocation."Bin Mandatory" then begin
        if not CurrLocation."Directed Put-away and Pick" then begin
            QtyAvailableBase :=
                CalcAvailableQty(ItemNo, VariantCode) -
                CalcPickQtyAssigned(LocationCode, ItemNo, VariantCode, UnitofMeasureCode, '', TempWhseItemTrackingLine2);
            // NEW BEGIN
            OnAfterSetQtyAvailableBaseForDirectedPutAwayAndPick(ItemNo, VariantCode, LocationCode, UnitofMeasureCode, QtyAvailableBase, TempWhseItemTrackingLine2);
            // NEW END
            if QtyAvailableBase > 0 then begin
                if TotalQtytoPickBase > QtyAvailableBase then
                    TotalQtytoPickBase := QtyAvailableBase;
                // ...

[IntegrationEvent(false, false)]
local procedure OnAfterSetQtyAvailableBaseForDirectedPutAwayAndPick(ItemNo: Code[20]; VariantCode: Code[10];LocationCode: Code[10]; UnitofMeasureCode: Code[10]; QtyAvailableBase: Decimal; var TempWhseItemTrackingLine2: Record "Whse. Item Tracking Line" temporary;)
begin
end;

Additional context

I want to fill a logistic log where I document different quantities like the QtyAvailableBase. Internal work item: AB#544577

JesperSchulz commented 2 months 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.

Build ID: 23054.