Skip to main content

system.kanoa.event.updateProductionEvent(productionEventInfo, userId)

Updates a new modeEvent record. Similar to updateModeEvent, but updates all fields.


Parameters

productionEventInfo Dictionary: All keys are required, unless otherwise stated

- assetIdIntegerId of asset
- comment:Notrequired
- itemIdIntegerNot required. Id of item
- modeCodeInteger
- modeEventIdIntegerId of the modeEvent record to update
- modeSourceIdIntegerWhether this is coming from the schedule, operator or plc (tag change)
- standardRateFloatNot required
- tStampDateTimeTime stamp of mode event
- workOrderIdIntegerNot required. Id of workorder

userId Integer:Id of the user executing the function


Returns

# of records modified Integer
message String None if success


Example


userId = 5
productionEventInfo = {'modeEventId': 55467, 'assetId': 901, 'modeCode': 1, 'modeSourceId': 1, 'tStamp': system.date.now()}
recordsModified, msg = system.kanoa.event.updateProductionEvent(productionEventInfo, userId)