system.mes.productionOrder.startProductionOrder
Description
Marks a production order as started. Sets the order status to RUNNING, records the start time, clears the end date,
and resolves the active shift record for the order's location at the start time.
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.startProductionOrder(idOrName, [startDate], [quantity], [quantityScheduled])
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
idOrName | String | False | The ULID or name of the production order. |
startDate | Date | True | Optional start time. If null, the current time is used. |
quantity | Double | True | Optional total quantity to set on the order. |
quantityScheduled | Double | True | Optional scheduled quantity to set on the order. |
Returns
Returns a JSON representation of the updated production order.
Code Examples
# Start a production order now
order = system.mes.productionOrder.startProductionOrder(idOrName="ORDER-001", startDate=system.date.now())
print order["status"] # "RUNNING"