system.mes.productionOrder.closeProductionOrder
Description
Closes a production order. Sets the status to CLOSED. The end date is set only if the order does not already
have one.
caution
Throws if the order's status is already CLOSED - closing an already-closed order is not permitted.
Permissions
This method requires the PRODUCTION_ORDER.EXECUTE permission.
Syntax
system.mes.productionOrder.closeProductionOrder(idOrName, [endDate])
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
idOrName | String | False | The ULID or name of the production order. |
endDate | Date | True | Optional end date, only applied if the order does not already have one. |
Returns
Returns a JSON representation of the updated production order.
Code Examples
# Close a production order
order = system.mes.productionOrder.closeProductionOrder(idOrName="ORDER-001")
print order["status"] # "CLOSED"