Skip to main content

system.mes.productionOrder.getDetailedProductionOrdersByLocationAndStatus

Description

Retrieves a list of detailed Production Orders records filtered by location IDs or paths and statuses.

Syntax

system.mes.productionOrder.getDetailedProductionOrdersByLocationAndStatus(locationIdsOrPaths, statuses)

Parameters

ParameterTypeNullableDescription
locationIdsOrPathsList[String]TrueA list of location IDs (ULIDs) or location paths to filter by.
statusesList[String]TrueA list of statuses to filter by (e.g., IDLE, SCHEDULED, RUNNING, PAUSED, STOPPED, CLOSED, CANCELLED).

Returns

Returns a list of JSON objects representing detailed production orders that match the given location IDs or paths and statuses. Each object contains expanded information including related entities such as property values and bill of materials.

NameTypeDescription
productNameStringThe name of the material produce to be produced in this production order.
locationNameStringThe name of the location that is associated with this production order.
unitOfMeasureNameStringThe name of the unit of measure that is associated with this production order.
propertyValuesList<JSON Object>The property values of the production order.
billOfMaterialsList<JSON Object>The bill of materials associated with this production order.
nameStringThe name of the production order.
productIdString (ULID)The ULID of the material produce to be produced.
locationIdString (ULID)The ULID of the location associated with this production order.
statusStringThe status of the production order. (e.g., IDLE, SCHEDULED, RUNNING, PAUSED, STOPPED, CLOSED, CANCELLED).
schedulePriorityStringThe schedule priority of the production order (e.g., LOW, NORMAL, HIGH, URGENT).
quantityDoubleThe total quantity to be produced in this production order.
quantityProducedDoubleThe quantity that has been already produced in this production order.
quantityScheduledDoubleThe quantity that has been scheduled to be produced in this production order.
startDateInstantThe date this production order started.
endDateInstantThe date this production order ended.
dueDateInstantThe date this production order is due.
unitOfMeasureIdString (ULID)The ULID of the unit of measure for this production order.
shiftRecordIdString (ULID)The ULID of the shift the production order started in.
idString (ULID)The ULID of the production order.
notesStringNotes related to the production order.
enabledBooleanIndicates if the production order 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 detailed production orders for specific locations and statuses
locationIdsOrPaths = ['Enterprise/Site/Area/Line1', 'Enterprise/Site/Area/Line2']
statuses = ['RUNNING', 'SCHEDULED']

detailedOrders = system.mes.productionOrder.getDetailedProductionOrdersByLocationAndStatus(
locationIdsOrPaths,
statuses
)

# Output the list of detailed production orders
print(detailedOrders)
# Retrieve all detailed production orders regardless of location or status
detailedOrders = system.mes.productionOrder.getDetailedProductionOrdersByLocationAndStatus(None, None)

# Output the list of detailed production orders
print(detailedOrders)