This creates an assembly with Bill of Materials and Routing position.
See
![]()
let item1="MyItem";
bsl.post("Item",{"ItemCode":item1,"ItemName":"Main Level order",
"Barcode":"0440000441000", // Create the Barcode with sub entry
"ManageSerialNumbers":false,
"ManageBatchNumbers":false,
"BatchnumberGeneration":"N",
"Breakdown":"A",
"ProcurementMethod":"M",
"ProductionUnit":"box", // All different UoMs. Alternative you can use "UoM":"Pcs" for all defintions.
"PurchaseUnit":"Pcs", // the UoM must existing in the UoM table
"InventoryUoMEntry":"Pcs",
"SalesUnit":"Pcs",
"DefaultWareHouse":"01",
"ProductionLotSizeUnit":0,
"ProductionLotSize":0
});
// Normal item
bsl.post("Item",{"ItemCode":(item1+"-Normal"),"ItemName":"Material Normal","Barcode":"50440000441001",
"Breakdown":"K", "ManageSerialNumbers":false, "ManageBatchNumbers":false, "UoM":"Pcs","DefaultWareHouse":"01"});
// Batch managed item
bsl.post("Item",{"ItemCode":(item1+"-Batch"),"ItemName":"Material batch managed",
"Breakdown":"K", "ManageSerialNumbers":false, "ManageBatchNumbers":true, "UoM":"Pcs","DefaultWareHouse":"01"});
// Serial managed item
bsl.post("Item",{"ItemCode":(item1+"-Serial"),"ItemName":"Material Serial managed",
"Breakdown":"K", "ManageSerialNumbers":true, "ManageBatchNumbers":false, "UoM":"Pcs","DefaultWareHouse":"01"});
// Batch and item version managed item
bsl.post("Item",{"ItemCode":(item1+"-BatchVersion"),"ItemName":"Material Batch VersionControl",
"Breakdown":"K", "ManageSerialNumbers":false, "ManageBatchNumbers":true, "UoM":"Pcs","DefaultWareHouse":"01","IVersionId":"001"});
// And 2 Versions for this batch managed item
bsl.post("ItemVersion",{"ItemCode":(item1+"-BatchVersion"),"IVersionId":"001","Description":"Material Batch - Version 1","status":"release"});
bsl.post("ItemVersion",{"ItemCode":(item1+"-BatchVersion"),"IVersionId":"002","Description":"Material Batch - Version 2","status":"release"});
// Bill of Material
bsl.post("BillOfMaterial",{"BillOfMaterialId":item1,"Description":"Bom ","RoutingId":item1,"Line":[
{"LineNumber":10,"ItemCode":(item1+"-Normal") ,"Quantity":1,"RoundingType":-1},
{"LineNumber":20,"ItemCode":(item1+"-Batch") ,"Quantity":2.1,"RoundingType":-1},
{"LineNumber":30,"ItemCode":(item1+"-Serial") ,"Quantity":1,"RoundingType":-1},
{"LineNumber":40,"ItemCode":(item1+"-BatchVersion") ,"Quantity":1,"RoundingType":-1,"IVersionId":"002"},
{"LineNumber":50,"ItemCode":(item1+"-Batch") ,"Quantity":1,"RoundingType":-1}
]});
// Routing position
bsl.post("Routing",{"RoutingId":item1,"Description":"WEB APP SSCC TestRouting","Line":[
{"CatalogId":"OP-IN.STD.001"}
]});