Skip to content

[W1][Codeunit][7313][Create Put-away] Add integration event OnBeforeCreateBinContent in Procedure CalcQtyToPutAway #30147

@mavohra

Description

@mavohra

Why do you need this change?

We need to add additional checks before calling CreateNewWhseActivity and change the parameter values inside that procedure.

Describe the request

Please add an event OnBeforeCreateBinContent in Procedure CalcQtyToPutAway

 procedure CalcQtyToPutAway(EmptyZoneBin: Boolean; NewBinContent: Boolean)
    var
        ActionType: Enum "Warehouse Action Type";
ishandled : Boolean;
    begin
        if CurrLocation."Bin Mandatory" then begin
            ActionType := ActionType::Place;
            if not EmptyZoneBin and (CurrLocation."Bin Capacity Policy" <> CurrLocation."Bin Capacity Policy"::"Never Check Capacity") then
                CalcAvailCubageAndWeight();
            AssignQtyToPutAwayForBinMandatory();
        end else
            QtyToPutAwayBase := PostedWhseReceiptLine."Qty. (Base)";

        OnCalcQtyToPutAwayOnAfterSetQtyToPutAwayBase(
            PostedWhseReceiptLine, CurrLocation, CurrBin, CrossDockInfo, EmptyZoneBin, QtyToPutAwayBase, EverythingHandled, RemQtyToPutAwayBase, NewBinContent);
        QtyToPickBase := QtyToPickBase + QtyToPutAwayBase;
        if QtyToPutAwayBase > 0 then begin
            OnBeforeCreateBinContent(Location,PostedWhseReceiptLine, CurrBin, QtyToPutAwayBase,ishandled); //<-- new event
ishandled := false;
            if not ishandled then begin
            LineNo := LineNo + 10000;
            if NewBinContent and CurrLocation."Directed Put-away and Pick" then
                CreateBinContent(PostedWhseReceiptLine);
            CreateNewWhseActivity(
              PostedWhseReceiptLine, CurrWarehouseActivityLine, ActionType, LineNo,
              0, QtyToPutAwayBase, true, false, EmptyZoneBin, false)
              end;
        end
    end;

Event signature:

[integrationEvent(false, false)]
    local procedure OnBeforeCreateBinContent(Location: Record Location; PostedWhseReceiptLine: Record "Posted Whse. Receipt Line"; CurrBin: Record Bin; QtyToPutAwayBase: Decimal; var IsHandled: Boolean)
    begin
    end;

Metadata

Metadata

Assignees

No one assigned

    Labels

    missing-infoThe issue misses information that prevents it from completion.

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions