This page "Drills Down" to EMPTY FIELDS. The Production BOM and Routing tables are NOT read before linking.
The fix is below. Microsoft error in italics, correction in bold.
field("RoutingNo."; Rec."Routing No.")
{
ApplicationArea = Manufacturing;
Lookup = false;
ToolTip = 'Specifies the production route that contains the operations needed to manufacture this item.';
trigger OnDrillDown()
var
RoutingHeader: Record "Routing Header";
begin
// if RoutingHeader."No." <> '' then
// RoutingHeader.SetRange("No.", Rec."Routing No.");
If Rec."Routing No." <> '' then begin
RoutingHeader.SetRange("No.", Rec."Routing No.");
Page.Run(Page::Routing, RoutingHeader);
end;
end;
}
field("ProductionBOMNo."; Rec."Production BOM No.")
{
ApplicationArea = Manufacturing;
Lookup = false;
ToolTip = 'Specifies the production BOM that is used to manufacture this item.';
trigger OnDrillDown()
var
ProductionBOMHeader: Record "Production BOM Header";
begin
// if ProductionBOMHeader."No." <> '' then
// ProductionBOMHeader.SetRange("No.", Rec."Production BOM No.");
if Rec."Production BOM No." <> '' then begin
ProductionBOMHeader.SetRange("No.", Rec."Production BOM No.");
Page.Run(Page::"Production BOM", ProductionBOMHeader);
end;
end;
}
