microsoft / ALAppExtensions

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

Add event OnBeforeUpdateQuantitiesToPick into codeunit 7312 "Create Pick" (procedure FindBWPickBin) #26738

Open Flavioide opened 2 weeks ago

Flavioide commented 2 weeks ago

Describe the request

[IntegrationEvent(false, false)]
local procedure OnBeforeUpdateQuantitiesToPick (var SkipUpdateQuantitiesToPick: :boolean;BinCode:code[20];QtyAvailableBase: Decimal; FromQtyPerUOM: Decimal; var FromQtyToPick: Decimal; var FromQtyToPickBase: Decimal; ToQtyPerUOM: Decimal; var ToQtyToPick: Decimal; var ToQtyToPickBase: Decimal; var TotalQtyToPick: Decimal; var TotalQtyToPickBase: Decimal)
begin
end;
SkipUpdateQuantitiesToPick: boolean;
                    if QtyAvailableBase > 0 then begin
                        IsHandled := false;
                        OnFindBWPickBinOnBeforeSetQtyAvailableBaseForSerialNo(FromBinContent, QtyAvailableBase, IsHandled);
                        if not IsHandled then
                            if WhseItemTrackingSetup."Serial No. Required" then
                                QtyAvailableBase := 1;

                        OnBeforeUpdateQuantitiesToPick(SkipUpdateQuantitiesToPick
                                                                           , FromBinContent."bin code"
                                                                            , QtyAvailableBase
                                                                            , FromQtyPerUOM
                                                                            , FromQtyToPick
                                                                            , FromQtyToPickBase
                                                                            , ToQtyPerUOM
                                                                            , ToQtyToPick
                                                                            , ToQtyToPickBase
                                                                            , TotalQtyToPick
                                                                            , TotalQtyToPickBase);
                        if not SkipUpdateQuantitiesToPick then
                        UpdateQuantitiesToPick(
                            QtyAvailableBase,
                            QtyPerUnitofMeasure, QtytoPick, QtyToPickBase,
                            QtyPerUnitofMeasure, QtytoPick, QtyToPickBase,
                            TotalQtyToPick, TotalQtyToPickBase);

Additional context

This event is usefull for anyone want to manage differently the quantities to pick Internal work item: AB#539364