Skip to main content

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

Adds a new modeEvent record. . Similar to addModeEvent, 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
- 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

modeEventId Integer
message String None if success


Example


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