system.mes.productionOrder.findProductionOrderPropertyValues
Description
Retrieves Production Order Property Values records in bulk based on the specified pagination, sort, and column constraint parameters.
Unlike getProductionOrderPropertyValuesForOrder, this method is not scoped to a single order. A single query can pull property values that span many production orders at once, which is useful when order data and its associated property data need to be accessed or manipulated together in bulk. Each returned value carries its productionOrderId and propertyId, so it can be correlated back to the order and property it belongs to.
Permissions
This method requires the PRODUCTION_ORDER.READ.GET permission.
Syntax
system.mes.productionOrder.findProductionOrderPropertyValues(**queryRequest)
Parameters
Using Python keyword arguments, a Query Request can be passed to the findProductionOrderPropertyValues function
without specifying each parameter individually. Please refer to the Query Request documentation for a list of parameters.
| Parameter | Type | Nullable | Description |
|---|---|---|---|
queryRequest | Query Request | False | A Query Request with the desired pagination, sorting, and filtering parameters. |
Returns
Returns a Query Result object with the following properties:
| Name | Type | Description |
|---|---|---|
content | List<Production Order Property Value> | The list of all records found that meet the specified criteria |
totalPages | Integer | If pagination is used, this is the number of total pages of records in the database for the specified page size. |
totalElements | Long | If pagination is used, this is the number of records in the database that meet the specified criteria. |
pageSize | Integer | If pagination is used, this is the specified page size. |
pageIndex | Integer | If pagination is used, this is the specified page index. |
hasContent | Boolean | True if any records were found that meet the specified criteria. |
isFirst | Boolean | If pagination is used, this is true if the first page was returned. |
isLast | Boolean | If pagination is used, this is true if the last page was returned. |
hasNext | Boolean | If pagination is used, this is true if there is a page of content available after this one. |
hasPrevious | Boolean | If pagination is used, this is true if there is a page of content available before this one. |
Production Order Property Value
| Name | Type | Description |
|---|---|---|
productionOrderId | String (ULID) | The ULID of the production order this value belongs to. |
propertyId | String (ULID) | The ULID of the production order property this is a value for. |
dataType | String | The data type of the property value. Must be the same as the data type of the property. |
value | Mixed | The value assigned to the property value. The type is mixed as it depends on what dataType is. |
id | String (ULID) | The ULID of the production order property value. |
notes | String | Notes related to the production order property value. |
enabled | Boolean | Indicates if the property value is active and enabled. |
spare1 | String | Additional field for user-defined context. |
spare2 | String | Additional field for user-defined context. |
spare3 | String | Additional field for user-defined context. |
Code Examples
Here is an example of retrieving, across all production orders, the first fifty property values for a specific property, sorted by the production order they belong to.
# Generate the object structure for a new query request
queryRequest = system.mes.query.newQueryRequest()
# Set the basic attributes of the query request
queryRequest['pageSize'] = 50
queryRequest['pageIndex'] = 0
queryRequest['sortFields'] = ['productionOrder']
queryRequest['sortDirections'] = ['Ascending']
# Generate the object structure for a filter for the query request
filterRequest = system.mes.query.newFilterRequest()
filterRequest['field'] = 'property.name'
filterRequest['condition'] = 'equals'
filterRequest['stringValue'] = 'Batch Number'
queryRequest['filters'] = [filterRequest]
# Retrieve the property values that match the filter, spanning every production order
result = system.mes.productionOrder.findProductionOrderPropertyValues(**queryRequest)
# Output the property values that match the filter.
print(result)