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 OnAfterCopyFromRoutingLine in the procedure InitProdOrderRoutingLine in Codeunit 99000773 "Calculate Prod. Order"
procedure InitProdOrderRoutingLine(var ProdOrderRoutingLine: Record "Prod. Order Routing Line"; RoutingLine: Record "Routing Line")
var
WorkCenter: Record "Work Center";
MachineCenter: Record "Machine Center";
begin
ProdOrderRoutingLine.Init();
ProdOrderRoutingLine.Status := ProdOrderLine.Status;
ProdOrderRoutingLine."Prod. Order No." := ProdOrderLine."Prod. Order No.";
ProdOrderRoutingLine."Routing Reference No." := ProdOrderLine."Routing Reference No.";
ProdOrderRoutingLine."Routing No." := ProdOrderLine."Routing No.";
ProdOrderRoutingLine.CopyFromRoutingLine(RoutingLine);
OnAfterCopyFromRoutingLine(ProdOrderRoutingLine, RoutingLine); // <--- New Event
case ProdOrderRoutingLine.Type of
ProdOrderRoutingLine.Type::"Work Center":
begin
WorkCenter.Get(RoutingLine."Work Center No.");
ProdOrderRoutingLine."Flushing Method" := WorkCenter."Flushing Method";
end;
ProdOrderRoutingLine.Type::"Machine Center":
begin
MachineCenter.Get(ProdOrderRoutingLine."No.");
ProdOrderRoutingLine."Flushing Method" := MachineCenter."Flushing Method";
end;
end;
OnTransferRoutingOnBeforeCalcRoutingCostPerUnit(ProdOrderRoutingLine, ProdOrderLine, RoutingLine);
CostCalcMgt.CalcRoutingCostPerUnit(
ProdOrderRoutingLine.Type, ProdOrderRoutingLine."No.",
ProdOrderRoutingLine."Direct Unit Cost", ProdOrderRoutingLine."Indirect Cost %", ProdOrderRoutingLine."Overhead Rate",
ProdOrderRoutingLine."Unit Cost per", ProdOrderRoutingLine."Unit Cost Calculation");
OnTransferRoutingOnbeforeValidateDirectUnitCost(ProdOrderRoutingLine, ProdOrderLine, RoutingLine);
ProdOrderRoutingLine.Validate("Direct Unit Cost");
ProdOrderRoutingLine."Starting Time" := ProdOrderLine."Starting Time";
ProdOrderRoutingLine."Starting Date" := ProdOrderLine."Starting Date";
ProdOrderRoutingLine."Ending Time" := ProdOrderLine."Ending Time";
ProdOrderRoutingLine."Ending Date" := ProdOrderLine."Ending Date";
ProdOrderRoutingLine.UpdateDatetime();
OnAfterTransferRoutingLine(ProdOrderLine, RoutingLine, ProdOrderRoutingLine);
ProdOrderRoutingLine.Insert();
OnAfterInsertProdRoutingLine(ProdOrderRoutingLine, ProdOrderLine);
end;
[IntegrationEvent(false, false)]
local procedure OnAfterCopyFromRoutingLine(var ProdOrderRoutingLine: Record "Prod. Order Routing Line"; RoutingLine: Record "Routing Line")
begin
end;
Additional context
We need to add our custom logic related to initializing Unit Costs and our custom fields after ProdOrderRoutingLine.CopyFromRoutingLine(RoutingLine); is called and before the case statement to check the ProdOrderRoutingLine.Type
The text was updated successfully, but these errors were encountered:
Describe the request
Please add an event OnAfterCopyFromRoutingLine in the procedure InitProdOrderRoutingLine in Codeunit 99000773 "Calculate Prod. Order"
Additional context
We need to add our custom logic related to initializing Unit Costs and our custom fields after
ProdOrderRoutingLine.CopyFromRoutingLine(RoutingLine);
is called and before the case statement to check theProdOrderRoutingLine.Type
The text was updated successfully, but these errors were encountered: