Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

The MES Work Order Table component provides a method for adding information to Work Orders through the use of custom properties. In this example, we can set specific lots of raw material that should be used when processing a work order. This same concept could be used to associate raw materials or virtually any other type of data.

Applies To and Version Info

This feature applies to the OEE 2.0 and Track & Trace modules and is available in all versions.

Details

Add the following entries to the User Menu Items property of the MES Work Order Table  component:

...

Code Block
languagepy
if event.getMenuItemName() == 'Associate Material Lots':
	woObj = event.getWorkOrder()
	#Add Material lots to be used for this Work Order as a custom property
	parentPath = 'Required Material Lots' 
	dataType = 'String'
	description = ''
	units = ''
	productionVisible = True
	required = False
	
	#Add Required Material Lots custom property directly to the MES object
	woObj.addCustomProperty(parentPath, dataType, 'Lots To Be Used', '', productionVisible, required)
	
	name = 'First Lot'
	value = 'A1000'	 	
	woObj.addCustomProperty(parentPath, name, dataType, description, units, productionVisible, required, value)
	
	name = 'Second Lot'
	value = 'B1000'	 	
	woObj.addCustomProperty(parentPath, name, dataType, description, units, productionVisible, required, value)
	
	print woObj.getCustomPropertiesFull()
	system.mes.saveMESObject(woObj)
elif event.getMenuItemName() == 'Get Material Lots':
	woObj = event.getWorkOrder()
	print woObj.getCustomPropertiesFull()	

 

You can then use the MES Work Order Table Scripting 

-> onColumnsCreate to add custom columns

-> onRowAdd to popupate the above column

References

MES Work Order Table

MES Work Order

 


Pagedetails