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 OnBeforeGenerateProdOrderLineSubTree in the procedure GenerateProdOrderLineSubTree in Codeunit 5870 "Calculate BOM Tree"
local procedure GenerateProdOrderLineSubTree(ProdOrderLine: Record "Prod. Order Line"; var BOMBuffer: Record "BOM Buffer"): Boolean
var
OldProdOrderLine: Record "Prod. Order Line";
ProdOrderComp: Record "Prod. Order Component";
ParentBOMBuffer: Record "BOM Buffer";
IsHandled: Boolean;
begin
OnBeforeGenerateProdOrderLineSubTree(ProdOrderLine, BOMBuffer, ParentBOMBuffer, IsHandled); // <--- New Event
if IsHandled then
exit;
ParentBOMBuffer := BOMBuffer;
ProdOrderComp.SetRange(Status, ProdOrderLine.Status);
ProdOrderComp.SetRange("Prod. Order No.", ProdOrderLine."Prod. Order No.");
ProdOrderComp.SetRange("Prod. Order Line No.", ProdOrderLine."Line No."); // <----- We need to use a setfilter here instead of setrange
if ProdOrderComp.FindSet() then begin
repeat
if ProdOrderComp."Item No." <> '' then begin
OldProdOrderLine.Get(ProdOrderComp.Status, ProdOrderComp."Prod. Order No.", ProdOrderComp."Prod. Order Line No."); // <-----we need to send `ProdOrderLine."Line No."` instead of ProdOrderComp."Prod. Order Line No."
if ProdOrderLine."Due Date" <> OldProdOrderLine."Due Date" then
ProdOrderComp."Due Date" := ProdOrderComp."Due Date" - (OldProdOrderLine."Due Date" - ProdOrderLine."Due Date");
BOMBuffer.SetLocationVariantFiltersFrom(ItemFilter);
BOMBuffer.TransferFromProdOrderComp(EntryNo, ProdOrderComp);
GenerateItemSubTree(ProdOrderComp."Item No.", BOMBuffer);
end;
until ProdOrderComp.Next() = 0;
BOMBuffer := ParentBOMBuffer;
exit(true);
end;
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeGenerateProdOrderLineSubTree(ProdOrderLine: Record "Prod. Order Line"; var BOMBuffer: Record "BOM Buffer"; var ParentBOMBuffer: Record "BOM Buffer"; var IsHandled: Boolean)
begin
end;
Additional context
We would like to have an event with isHandled parameter to override the code with our custom code.
We need to change the ProdOrderComp.SetRange("Prod. Order Line No.", ProdOrderLine."Line No."); to use ProdOrderComp.SetFilter("Prod. Order Line No.", '%1|0', ProdOrderLine."Line No.") on line No. 466
additionally, we need to send ProdOrderLine."Line No." instead of ProdOrderComp."Prod. Order Line No." in the OldProdOrderLine.Get on Line No. 470
The text was updated successfully, but these errors were encountered:
Describe the request
Please add an event OnBeforeGenerateProdOrderLineSubTree in the procedure GenerateProdOrderLineSubTree in Codeunit 5870 "Calculate BOM Tree"
Additional context
We would like to have an event with isHandled parameter to override the code with our custom code.
We need to change the
ProdOrderComp.SetRange("Prod. Order Line No.", ProdOrderLine."Line No.");
to useProdOrderComp.SetFilter("Prod. Order Line No.", '%1|0', ProdOrderLine."Line No.")
on line No. 466additionally, we need to send
ProdOrderLine."Line No."
instead of ProdOrderComp."Prod. Order Line No." in theOldProdOrderLine.Get
on Line No. 470The text was updated successfully, but these errors were encountered: