Skip to main content

system.kanoa.cmms.updateWorkOrderEventStatusField(workOrderEventStatusId, field, value, userId)

Updates a single named field on a work order event status record identified by workOrderEventStatusId. Call this for a targeted, single-column change (for example, toggling enabled or renaming a status) without having to resupply the entire status dictionary as required by updateWorkOrderEventStatus. The field argument must be one of a fixed set of valid column names.


Parameters

workOrderEventStatusId Integer: Id of workOrderEventStatusId to update
field String: Valid options are workOrderEventStatusName, workOrderEventStatusCategoryId, enabled, sortOrder, isActive
value String: Value to update to
userId Integer:Id of the user executing the function


Returns

# of records modified Integer
message String None if success


Example

workOrderEventStatusId = 17
field = "isActive"
value = False
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})

recordsModified, message = system.kanoa.cmms.updateWorkOrderEventStatusField(workOrderEventStatusId, field, value, userId)
print recordsModified, message