Skip to main content
Version: V2 (Ignition 8.1)

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.

ParameterTypeNullableDescription
queryRequestQuery RequestFalseA Query Request with the desired pagination, sorting, and filtering parameters.

Returns

Returns a Query Result object with the following properties:

NameTypeDescription
contentList<Production Order Property Value>The list of all records found that meet the specified criteria
totalPagesIntegerIf pagination is used, this is the number of total pages of records in the database for the specified page size.
totalElementsLongIf pagination is used, this is the number of records in the database that meet the specified criteria.
pageSizeIntegerIf pagination is used, this is the specified page size.
pageIndexIntegerIf pagination is used, this is the specified page index.
hasContentBooleanTrue if any records were found that meet the specified criteria.
isFirstBooleanIf pagination is used, this is true if the first page was returned.
isLastBooleanIf pagination is used, this is true if the last page was returned.
hasNextBooleanIf pagination is used, this is true if there is a page of content available after this one.
hasPreviousBooleanIf pagination is used, this is true if there is a page of content available before this one.

Production Order Property Value

NameTypeDescription
productionOrderIdString (ULID)The ULID of the production order this value belongs to.
propertyIdString (ULID)The ULID of the production order property this is a value for.
dataTypeStringThe data type of the property value. Must be the same as the data type of the property.
valueMixedThe value assigned to the property value. The type is mixed as it depends on what dataType is.
idString (ULID)The ULID of the production order property value.
notesStringNotes related to the production order property value.
enabledBooleanIndicates if the property value is active and enabled.
spare1StringAdditional field for user-defined context.
spare2StringAdditional field for user-defined context.
spare3StringAdditional 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)