microsoft / ALAppExtensions

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

[Event Change Request] Codeunit 7312 "Create Pick" - OnFindBWPickBinOnBeforeApplyBinCodeFilter #27030

Closed 1languste closed 1 month ago

1languste commented 1 month ago

Describe the request

I want to change the BinCodeFilterText based on the current location. Therefore, I request to add CurrLocation as a new Parameter to the OnFindBWPickBinOnBeforeApplyBinCodeFilter event:

local procedure FindBWPickBin(
        LocationCode: Code[10]; ItemNo: Code[20]; VariantCode: Code[10]; ToBinCode: Code[20]; UnitofMeasureCode: Code[10]; QtyPerUnitofMeasure: Decimal;
        QtyRoundingPrecision: Decimal; QtyRoundingPrecisionBase: Decimal; DefaultBin: Boolean; CrossDockBin: Boolean; var TotalQtyToPick: Decimal; var TotalQtyToPickBase: Decimal;
        var TempWhseItemTrackingLine2: Record "Whse. Item Tracking Line" temporary; WhseItemTrackingSetup: Record "Item Tracking Setup"; UserDefaultBin: Boolean)
var
    FromBinContent: Record "Bin Content";
    QtyAvailableBase: Decimal;
    QtyToPickBase: Decimal;
    QtytoPick: Decimal;
    BinCodeFilterText: Text[250];
    IsSetCurrentKeyHandled: Boolean;
    IsHandled: Boolean;
    EndLoop: Boolean;
begin
    // ...
    if not IsHandled then begin
        if CurrLocation."Require Pick" and (CurrLocation."Shipment Bin Code" <> '') then
            AddToFilterText(BinCodeFilterText, '&', '<>', CurrLocation."Shipment Bin Code");
        if CurrLocation."Require Put-away" and (CurrLocation."Receipt Bin Code" <> '') then
            AddToFilterText(BinCodeFilterText, '&', '<>', CurrLocation."Receipt Bin Code");
        if ToBinCode <> '' then
            AddToFilterText(BinCodeFilterText, '&', '<>', ToBinCode);
        // NEW BEGIN
        OnFindBWPickBinOnBeforeApplyBinCodeFilter(BinCodeFilterText, CurrLocation);
        // NEW END
        if BinCodeFilterText <> '' then
            FromBinContent.SetFilter("Bin Code", BinCodeFilterText);
        if WhseItemTrkgExists then begin
            WhseItemTrackingSetup.CopyTrackingFromWhseItemTrackingLine(TempWhseItemTrackingLine2);
            FromBinContent.SetTrackingFilterFromItemTrackingSetupIfRequiredWithBlank(WhseItemTrackingSetup);
        end;
    end;
    //...

[IntegrationEvent(false, false)]
local procedure OnFindBWPickBinOnBeforeApplyBinCodeFilter(var BinCodeFilterText: Text[250]; CurrLocation: Record Location)
begin
end;

Additional context

I want to change the BinCodeFilterText based on the current location bin codes (Service & To-Production). Internal work item: AB#544588

JesperSchulz commented 1 month 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.