You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there,
This is related to #26525 (comment), we still need a few more changes to make it work and split by item tracking.
In the requested event that is already added, we need the global WhseEntry as a parameter:
Previous:
local procedure ItemBinLocationIsCalculated(BinCode: Code[20]): Boolean
var
IsHandled: Boolean;
IsCalculated: Boolean;
begin
IsHandled := false;
OnBeforeItemBinLocationIsCalculated("Item Ledger Entry", IsHandled, IsCalculated);
if IsHandled then
exit(IsCalculated);
TempQuantityOnHandBuffer.Reset();
TempQuantityOnHandBuffer.SetRange("Item No.", "Item Ledger Entry"."Item No.");
TempQuantityOnHandBuffer.SetRange("Variant Code", "Item Ledger Entry"."Variant Code");
TempQuantityOnHandBuffer.SetRange("Location Code", "Item Ledger Entry"."Location Code");
TempQuantityOnHandBuffer.SetRange("Bin Code", BinCode);
exit(TempQuantityOnHandBuffer.Find('-'));
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeItemBinLocationIsCalculated(ItemLedgerEntry: Record "Item Ledger Entry"; var IsHandled: Boolean; var IsCalculated: Boolean)
begin
end;
New:
[IntegrationEvent(false, false)]
local procedure OnBeforeItemBinLocationIsCalculated(ItemLedgerEntry: Record "Item Ledger Entry"; var IsHandled: Boolean; var IsCalculated: Boolean; var WarehouseEntry: Record "Warehouse Entry")
begin
end;
local procedure ItemBinLocationIsCalculated(BinCode: Code[20]): Boolean
var
IsHandled: Boolean;
IsCalculated: Boolean;
begin
IsHandled := false;
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
OnBeforeItemBinLocationIsCalculated("Item Ledger Entry", IsHandled, IsCalculated, WhseEntry);
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
if IsHandled then
exit(IsCalculated);
TempQuantityOnHandBuffer.Reset();
TempQuantityOnHandBuffer.SetRange("Item No.", "Item Ledger Entry"."Item No.");
TempQuantityOnHandBuffer.SetRange("Variant Code", "Item Ledger Entry"."Variant Code");
TempQuantityOnHandBuffer.SetRange("Location Code", "Item Ledger Entry"."Location Code");
TempQuantityOnHandBuffer.SetRange("Bin Code", BinCode);
exit(TempQuantityOnHandBuffer.Find('-'));
end;
And a handler publisher to skip the findlast that moves the pointer for all the same bin codes, in the OnAfterGetRecord of "Item Ledger Entry":
if ExecuteLoop then begin
WhseEntry.SetRange("Item No.", "Item No.");
WhseEntry.SetRange("Location Code", "Location Code");
WhseEntry.SetRange("Variant Code", "Variant Code");
if WhseEntry.Find('-') then
if WhseEntry."Entry No." <> OldWhseEntry."Entry No." then begin
OldWhseEntry := WhseEntry;
repeat
WhseEntry.SetRange("Bin Code", WhseEntry."Bin Code");
if not ItemBinLocationIsCalculated(WhseEntry."Bin Code") then begin
WhseEntry.CalcSums("Qty. (Base)");
OnItemLedgerEntryOnAfterGetRecordOnBeforeUpdateBuffer(WhseEntry);
UpdateBuffer(WhseEntry."Bin Code", WhseEntry."Qty. (Base)", false);
end;
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
IsHandled := false;
OnWhseEntryLoopOnBeforeFindlast(WhseEntry, IsHandled);
if not isHandled then
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
WhseEntry.Find('+');
Item.CopyFilter("Bin Filter", WhseEntry."Bin Code");
until WhseEntry.Next() = 0;
end;
end;
[IntegrationEvent(false, false)]
local procedure OnWhseEntryLoopOnBeforeFindlast(var WarehouseEntry: Record "Warehouse Entry"; var Ishandled: Boolean)
begin
end;
Additional context
We need this to split by item tracking in report 790 "Calculate Inventory" in the specific case of bin codes
The text was updated successfully, but these errors were encountered:
Describe the request
Hi there,
This is related to #26525 (comment), we still need a few more changes to make it work and split by item tracking.
In the requested event that is already added, we need the global WhseEntry as a parameter:
Previous:
New:
And a handler publisher to skip the findlast that moves the pointer for all the same bin codes, in the OnAfterGetRecord of "Item Ledger Entry":
Additional context
We need this to split by item tracking in report 790 "Calculate Inventory" in the specific case of bin codes
The text was updated successfully, but these errors were encountered: