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
| - assetId | Integer | Id of asset |
| - comment: | Not | required |
| - itemId | Integer | Not required. Id of item |
| - modeCode | Integer | |
| - modeSourceId | Integer | Whether this is coming from the schedule, operator or plc (tag change) |
| - standardRate | Float | Not required |
| - tStamp | DateTime | Time stamp of mode event |
| - workOrderId | Integer | Not 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)