system.mes.productionOrder.scheduleProductionOrder
Description
Schedules a production order, optionally updating the scheduled quantity. If quantityScheduled is omitted or
None, the existing value on the order is kept.
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.scheduleProductionOrder(idOrName, [dueDate], [quantityScheduled])
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
idOrName | String | False | The ULID or name of the production order. |
dueDate | Date | True | Optional due date. If null, the existing value is kept. |
quantityScheduled | Double | True | Optional new scheduled quantity. If null, the existing value is kept. |
Returns
Returns a JSON representation of the updated production order.
Code Examples
# Schedule a production order with a specific quantity
order = system.mes.productionOrder.scheduleProductionOrder(idOrName="ORDER-001", dueDate=system.date.addHours(system.date.now(), 2), quantityScheduled=250.0)
print order["quantityScheduled"]