Want to create bill of Material Structure for Stock Keeping Unit. My all stock keeping unit has its own routing and production BOM.
Not ablet to understand on how to pass this on the BOM structure page. (Procedure 'InitItem') takes only Item as input and not stock keeping unit.
Already tried to define the OnAction trigger on page extension of StockKeeping Unit
My of code is
actions
{
//Add changes to page actions here
addafter(Warehouse)
{
group(BillOfMaterials)
{
Caption = 'Bill of Materials';
Image = Production;
action(BOMStructure)
{
ApplicationArea = Assembly;
Caption = 'Structure';
Image = Hierarchy;
ToolTip = 'View which child items are used in an item''s assembly BOM or production BOM. Each item level can be collapsed or expanded to obtain an overview or detailed view.';
trigger OnAction()
var
BOMStructure: Page "BOM Structure";
Item: Record Item;
begin
Item."No." := Rec."Item No.";
item."Replenishment System" := rec."Replenishment System";
item."Production BOM No." := rec."Production BOM No.";
item."Routing No." := rec."Routing No.";
Item.SetRange("Location Filter", Rec."Location Code");
Item.setrange("Variant Filter", Rec."Variant Code");
BOMStructure.InitItem(Item);
BOMStructure.Run;
end;
}
}
}
}