Skip to end of metadata
Go to start of metadata

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:

Add the following code to the UserMenuItemClicked() function of the MES Work Order Table component:

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


    Created By   Jason Coope Created Date  Jun 29, 2017 19:27 Last Modified By   Philippe Timothee Last Modifed Date   Nov 16, 2018 17:31


  • No labels