system.mes.workorder.createMESWorkOrder

Sepasoft MES Module Suite

system.mes.workorder.createMESWorkOrder(workOrderName, materialLink)

Creates a work order.

Success Work orders must be uniquely named. Duplicate names are not allowed.

MES Naming Convention

MES Object

Character that are Not Allowed

Exception
Production Equipment
. ? ! # % ^ * ~ [ ] { } + = ` \ @ & ( ) < >,

MES Person
. ? ! # % ^ * ~ [ ] { } + = ` \/ " $ | < >

All Other MES Objects
. ? ! # % ^ * ~ [ ] { } + = ` \/ " $ | ,

Machine Recipe Name
Follows the same convention as All Other MES Objects
Full-stop period . is allowed as of 3.81.10 SP2

Syntax

system.mes.workorder.createMESWorkOrder(workOrderName, materialLink)

  • Parameters

String workOrderName - Name of the work order to be created.

MESObjectLink   materialLink - A MES Object Link to a valid material definition to associate to the work order.

  • Returns

MESWorkOrder - A new instance of a MESWorkOrder object.

  • Scope

All

Code Example

Python
##Given a work order name, create the work order and then save the work order to manifest the change.
matLink = system.mes.getMESObjectLinkByName('MaterialDef', 'Fanta')
woObj=system.mes.workorder.createMESWorkOrder('7878', matLink)
system.mes.workorder.saveMESWorkOrder(woObj)
print woObj

Output

Code
WorkOrder (1c397a0d-6ae5-4591-8a54-a6278041b72a, 7878, 0 parents, 0 children, 0 custom properties, 0 complex properties)

Sepasoft MES Module Suite