Skip to main content

addCheckEvent

id: addCheckEvent

title: system.kanoa.quality.event.addCheckEvent(chkEventInfo, userId)

Adds a new check sheet event. Only chkShtId key is required


Parameters

chkEventInfo Dictionary

- assetIdIntegerNot required
- chkShtIdInteger
- chkShtStateIdIntegerNot required
- chkShtTriggerIdIntegerNot required. Links the coming due info to this check sheet
- commentStringNot required
- itemIdIntegerNot required
- scheduledDateDateTimeNot required
- shiftNameIdIntegerNot required
- triggerTypeId:Notrequired. Links what triggered this checksheet

userId Integer:Id of the user executing the function


Returns

chkShtEventId Integer


Example

chkShtStates = system.kanoa.utilities.convertDatasetToDict(system.kanoa.quality.sheet.getStates({'enabled': True}), 'chkShtStateName', 'chkShtStateId')
chkEventInfo = {
'chkShtId': 1,
'assetId': 18,
'shiftNameId': 1,
'itemId': 5,
'chkShtTriggerId': 3,
'chkShtStateId': chkShtStates['Due'],
'comment': None,
'scheduledDate': system.date.now()
}
userId = 123
chkShtEventId = system.kanoa.quality.event.addCheckEvent(chkEventInfo, userId)