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 the event OnBeforeCalcStandardCost in Procedure CalcStandardCost in Codeunit 5896 "Calc. Inventory Adjmt. - Order"
local procedure CalcStandardCost(var InvtAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)"; OutputQty: Decimal)
var
IsHandled: Boolean;
begin
OnBeforeCalcStandardCost(InvtAdjmtEntryOrder, OutputQty, IsHandled); // <--- New Event
if IsHandled then
exit;
if not InvtAdjmtEntryOrder.Find() or not InvtAdjmtEntryOrder."Completely Invoiced" then
InvtAdjmtEntryOrder.GetCostsFromItem(OutputQty)
else begin
InvtAdjmtEntryOrder.RoundCosts(OutputQty);
// !!! Our Custom logic needs to be added in this else statement. We would like an event either at start i.e (OnBeforeCalcStandardCost) or right after InvtAdjmtEntryOrder.RoundCosts(OutputQty); in the else statement. !!!
InvtAdjmtEntryOrder.CalcDirectCostFromCostShares();
InvtAdjmtEntryOrder.CalcIndirectCostFromCostShares();
InvtAdjmtEntryOrder.CalcUnitCost();
end;
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeCalcStandardCost(var InvtAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)"; OutputQty: Decimal; var IsHandled: Boolean)
begin
end;
Additional context
We need to adjust inventory adjustment costs for custom order types specifically within the else block of the CalcStandardCost procedure. Our logic must run either:
At the start of the procedure (to conditionally skip standard logic via IsHandled), or
Immediately after RoundCosts(OutputQty) in the else block (to inject adjustments after rounding).
Internal work item: AB#563988
The text was updated successfully, but these errors were encountered:
Describe the request
Please add the event OnBeforeCalcStandardCost in Procedure CalcStandardCost in Codeunit 5896 "Calc. Inventory Adjmt. - Order"
Additional context
We need to adjust inventory adjustment costs for custom order types specifically within the
else
block of theCalcStandardCost
procedure. Our logic must run either:IsHandled
), orRoundCosts(OutputQty)
in theelse
block (to inject adjustments after rounding).Internal work item: AB#563988
The text was updated successfully, but these errors were encountered: