Why do you need this change?
We need to intercept the bin content quantity calculation in GetFromBinContentQty in Codeunit 7312 "Create Pick" before the standard BinContent.Get call, to allow a subscriber to return a custom quantity and skip the standard bin content lookup.
The standard procedure performs a direct BinContent.Get followed by SetTrackingFilterFromWhseItemTrackingLine and CalcFields("Quantity (Base)"). This approach does not account for scenarios where the bin content quantity must be determined by alternative logic, such as when item tracking requires a calculation outside the standard Bin Content table structure.
The existing event OnCreateTempItemTrkgLinesOnBeforeGetFromBinContentQty fires in CreateTempItemTrkgLines immediately before the call to GetFromBinContentQty, but exposes only EntrySummary, ItemNo, VariantCode, and var TotalAvailQtyToPickBase. It does not provide LocCode, FromBinCode, UoMCode, or the WhseItemTrackingLine, and it cannot bypass the BinContent.Get call inside GetFromBinContentQty itself.
Describe the request
Add an integration event OnBeforeGetFromBinContentQty in GetFromBinContentQty in Codeunit 7312 "Create Pick" before BinContent.Get, with IsHandled to allow a subscriber to provide the result and skip the standard bin content lookup.
local procedure GetFromBinContentQty(LocCode: Code[10]; FromBinCode: Code[20]; ItemNo: Code[20]; Variant: Code[20]; UoMCode: Code[10]; WhseItemTrackingLine: Record "Whse. Item Tracking Line"): Decimal
var
BinContent: Record "Bin Content";
Result: Decimal;
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeGetFromBinContentQty(LocCode, FromBinCode, ItemNo, Variant, UoMCode, WhseItemTrackingLine, Result, IsHandled); // <---- New Event
if not IsHandled then begin
BinContent.Get(LocCode, FromBinCode, ItemNo, Variant, UoMCode);
BinContent.SetTrackingFilterFromWhseItemTrackingLine(WhseItemTrackingLine);
BinContent.CalcFields("Quantity (Base)");
Result := BinContent."Quantity (Base)";
end;
exit(Result);
end;
Event Signature:
[IntegrationEvent(false, false)]
local procedure OnBeforeGetFromBinContentQty(LocCode: Code[10]; FromBinCode: Code[20]; ItemNo: Code[20]; Variant: Code[20]; UoMCode: Code[10]; var WhseItemTrackingLine: Record "Whse. Item Tracking Line"; var Result: Decimal; var IsHandled: Boolean)
begin
end;
Alternatives evaluated: OnCreateTempItemTrkgLinesOnBeforeGetFromBinContentQty fires in CreateTempItemTrkgLines before GetFromBinContentQty is called, but exposes only EntrySummary, ItemNo, VariantCode, and var TotalAvailQtyToPickBase. It does not expose LocCode, FromBinCode, UoMCode, or the WhseItemTrackingLine, and it cannot bypass the BinContent.Get call inside the procedure. No other event exists at or inside GetFromBinContentQty.
Why do you need this change?
We need to intercept the bin content quantity calculation in
GetFromBinContentQtyin Codeunit 7312 "Create Pick" before the standardBinContent.Getcall, to allow a subscriber to return a custom quantity and skip the standard bin content lookup.The standard procedure performs a direct
BinContent.Getfollowed bySetTrackingFilterFromWhseItemTrackingLineandCalcFields("Quantity (Base)"). This approach does not account for scenarios where the bin content quantity must be determined by alternative logic, such as when item tracking requires a calculation outside the standardBin Contenttable structure.The existing event
OnCreateTempItemTrkgLinesOnBeforeGetFromBinContentQtyfires inCreateTempItemTrkgLinesimmediately before the call toGetFromBinContentQty, but exposes onlyEntrySummary,ItemNo,VariantCode, andvar TotalAvailQtyToPickBase. It does not provideLocCode,FromBinCode,UoMCode, or theWhseItemTrackingLine, and it cannot bypass theBinContent.Getcall insideGetFromBinContentQtyitself.Describe the request
Add an integration event
OnBeforeGetFromBinContentQtyinGetFromBinContentQtyin Codeunit 7312 "Create Pick" beforeBinContent.Get, withIsHandledto allow a subscriber to provide the result and skip the standard bin content lookup.Event Signature:
Alternatives evaluated: OnCreateTempItemTrkgLinesOnBeforeGetFromBinContentQty fires in CreateTempItemTrkgLines before GetFromBinContentQty is called, but exposes only EntrySummary, ItemNo, VariantCode, and var TotalAvailQtyToPickBase. It does not expose LocCode, FromBinCode, UoMCode, or the WhseItemTrackingLine, and it cannot bypass the BinContent.Get call inside the procedure. No other event exists at or inside GetFromBinContentQty.