W089: Get BOM for a SKU
Returns the BOM composition for one output SKU. Triggered from BOM Detail and from any workflow that needs to read the recipe (notably W129, Create work order, which uses it to compute material costs and seed the WO recipe snapshot).
Steps
-
Load the BOM header. Call
BOM.getBomForSku(outputSkuId). -
Load items. Call
BOM.listBomItems. -
Hydrate input names. Batch-resolve input material and input SKU names.
Returns
The BOM header plus items with input names hydrated, or null if the SKU has no BOM.
Business rules
None.
Errors
None. A SKU with no BOM returns null rather than throwing.