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
Please add an event OnAfterCalcExactCostReversingQty in the procedure CalcExactCostReversingQty in Codeunit 5896 "Calc. Inventory Adjmt. - Order"
local procedure CalcExactCostReversingQty(ItemLedgEntry: Record "Item Ledger Entry") Qty: Decimal
var
OutbndItemLedgEntry: Record "Item Ledger Entry";
ItemApplnEntry: Record "Item Application Entry";
TempItemLedgEntryInChain: Record "Item Ledger Entry" temporary;
begin
OutbndItemLedgEntry.SetCurrentKey("Order Type", "Order No.", "Order Line No.", "Entry Type");
OutbndItemLedgEntry.SetRange("Order Type", ItemLedgEntry."Order Type");
OutbndItemLedgEntry.SetRange("Order No.", ItemLedgEntry."Order No.");
OutbndItemLedgEntry.SetRange("Order Line No.", ItemLedgEntry."Order Line No.");
OutbndItemLedgEntry.SetRange("Entry Type", ItemLedgEntry."Entry Type");
OutbndItemLedgEntry.SetRange(Positive, false);
OutbndItemLedgEntry.SetFilter("Applies-to Entry", '<>0');
if OutbndItemLedgEntry.IsEmpty() then
exit(0);
ItemApplnEntry.GetVisitedEntries(ItemLedgEntry, TempItemLedgEntryInChain, true);
TempItemLedgEntryInChain.SetRange("Order Type", ItemLedgEntry."Order Type");
TempItemLedgEntryInChain.SetRange("Order No.", ItemLedgEntry."Order No.");
TempItemLedgEntryInChain.SetRange("Order Line No.", ItemLedgEntry."Order Line No.");
TempItemLedgEntryInChain.SetRange("Entry Type", ItemLedgEntry."Entry Type");
TempItemLedgEntryInChain.SetRange(Positive, false);
TempItemLedgEntryInChain.SetFilter("Applies-to Entry", '<>0');
TempItemLedgEntryInChain.CalcSums(Quantity);
Qty := TempItemLedgEntryInChain.Quantity;
OnAfterCalcExactCostReversingQty(ItemLedgEntry, Qty); // <--- New Event
end;
[IntegrationEvent(false, false)]
local procedure OnAfterCalcExactCostReversingQty(ItemLedgEntry: Record "Item Ledger Entry"; var Qty: Decimal)
begin
end;
Additional context
We want to override the calculation of Qty with our own logic.
The text was updated successfully, but these errors were encountered:
Describe the request
Please add an event OnAfterCalcExactCostReversingQty in the procedure CalcExactCostReversingQty in Codeunit 5896 "Calc. Inventory Adjmt. - Order"
Additional context
We want to override the calculation of
Qty
with our own logic.The text was updated successfully, but these errors were encountered: