Skip to main content

system.kanoa.cmms.updateWorkOrderEvent(workOrderEventInfo, userId)

Updates an existing work order event, identified by the workOrderEventId key inside workOrderEventInfo. All keys in the workOrderEventInfo dictionary are required for the call to succeed, including the ids of the work order event and its parent work order. The userId parameter records who performed the update for audit trail purposes.


Parameters

workOrderEventInfo Dictionary

- assetIdInteger
- assignedToInteger
- dueDateDateTime
- maintenanceSubTypeIdInteger
- requestedByInteger
- requestedDateDateTime
- workOrderEventIdIntegerId of the workOrder event
- workOrderEventNameStringName of the workOrder
- workOrderEventStatusIdInteger
- workOrderIdIntegerId of the workOrder
- workOrderPriorityIdInteger

userId Integer:Id of the user executing the function


Returns

# of records modified Integer
message String None if success


Example

# Update a work order event's status to Completed and adjust its priority
workOrderEventInfo = {
"assetId": 4021,
"assignedTo": 118,
"dueDate": "2026-08-01 08:00:00",
"maintenanceSubTypeId": 3,
"requestedBy": 205,
"requestedDate": "2026-07-27 09:15:00",
"workOrderEventId": 8842,
"workOrderEventName": "Pump 12 - Seal Inspection",
"workOrderEventStatusId": 4,
"workOrderId": 301,
"workOrderPriorityId": 2
}
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
recordsModified, message = system.kanoa.cmms.updateWorkOrderEvent(workOrderEventInfo, userId)
print recordsModified, message