Skip to main content
Version: V3 (Ignition 8.3)

system.mes.productionOrder.cancelProductionOrder

Description

Cancels a production order. Sets the status to CANCELLED. The end date is set only if the order does not already have one.

caution

Throws if the order's status is already CLOSED - no execution operations are permitted on a closed order.

Permissions

This method requires the PRODUCTION_ORDER.EXECUTE permission.

Syntax

system.mes.productionOrder.cancelProductionOrder(idOrName, [endDate])

Parameters

ParameterTypeNullableDescription
idOrNameStringFalseThe ULID or name of the production order.
endDateDateTrueOptional end date, only applied if the order does not already have one.

Returns

Returns a JSON representation of the updated production order.

Code Examples

# Cancel a production order
order = system.mes.productionOrder.cancelProductionOrder(idOrName="ORDER-001", endDate=system.date.now())
print order["status"] # "CANCELLED"