Skip to main content

system.mes.productionOrder.getBillOfMaterialsForOrderFlattened

Description

Retrieves a flattened representation of all Production Order Bill of Materials records associated with the given production order ID or name. This method flattens the bill of materials to a single level, no substitutions.

Syntax

system.mes.productionOrder.getBillOfMaterialsForOrderFlattened(productionOrderIdOrName)

Parameters

ParameterTypeDescription
productionOrderIdOrNameStringThe ULID or name of the production order to retrieve the flattened bill of materials.

Returns

Returns a list of flattened JSON objects representing the bill of materials associated with the given production order. Each object has the following properties:

NameTypeDescription
materialClassIdString (ULID)The ULID of the material class associated with the material.
materialClassNameStringThe name of the material class associated with the material.
materialClassDescriptionStringThe description of the material class associated with the material.
materialDescriptionStringThe description of the material that is a component of the produce.
productNameStringThe name of the product being produced.
productDescriptionStringThe description of the product being produced.
unitOfMeasureSymbolStringThe symbol of the unit of measure for this bill of materials.
productionOrderNameStringThe name of the production order associated with this bill of materials.
subsList<JSON>List of sub-components related to this bill of materials item.
productIdString (ULID)The ULID for the material to be produced.
productionOrderIdString (ULID)The ULID for the production order associated with this bill of materials.
materialNameStringThe name of the material that is a component of the produce.
materialIdString (ULID)The ULID of the material that is a component of the produce.
quantityPerProducedUnitDoubleThe quantity of the material used per unit produced of the product.
quantityOrderDoubleThe quantity of the material used per order.
unitOfMeasureIdString (ULID)The ULID of the unit of measure for this bill of materials.
unitOfMeasureNameStringThe name of the unit of measure for this bill of materials.
positionIntegerThe position of this bill of materials for the product.
materialGroupStringThe material group of the material associated with this bill of materials.
materialTypeStringThe material type of the material associated with this bill of materials.
idString (ULID)The ULID of the bill of materials.
notesStringNotes related to the bill of materials.
enabledBooleanIndicates if the bill of materials is active and enabled.
spare1StringAdditional field for user-defined context.
spare2StringAdditional field for user-defined context.
spare3StringAdditional field for user-defined context.

Code Examples

# Retrieve the flattened bill of materials for a given production order
flattened_bill_of_materials = system.mes.productionOrder.getBillOfMaterialsForOrderFlattened('01JPMTA7K3-E8EHA4MD-7C304P4Z')

# Output the flattened bill of materials
print(flattened_bill_of_materials)