# 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<br />
<table class='dictionaryKeyTable'>
	<tbody>
 	<tr><td> - assetId</td><td>Integer</td><td>Id of asset</td></tr>	
 	<tr><td> - comment:</td><td>Not</td><td>required</td></tr>	
 	<tr><td> - itemId</td><td>Integer</td><td>Not required. Id of item</td></tr>	
 	<tr><td> - modeCode</td><td>Integer</td><td></td></tr>	
 	<tr><td> - modeSourceId</td><td>Integer</td><td>Whether this is coming from the schedule, operator or plc (tag change)</td></tr>	
 	<tr><td> - standardRate</td><td>Float</td><td>Not required</td></tr>	
 	<tr><td> - tStamp</td><td>DateTime</td><td>Time stamp of mode event</td></tr>	
 	<tr><td> - workOrderId</td><td>Integer</td><td>Not required. Id of workorder</td></tr>	
	</tbody>
</table>

**userId** `Integer`:Id of the user executing the function<br />

---
### Returns
**modeEventId** `Integer`<br />
**message** `String` None if success<br />

---
### Example
```python

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