system.kanoa.cmms.updateWorkOrderPriorityField(workOrderPriorityId, field, value, userId)
Updates a single field on an existing work order priority record, identified by workOrderPriorityId, without requiring the full record to be supplied.
Useful for quick single-field edits such as renaming a priority or toggling its enabled state.
Parameters
workOrderPriorityId Integer: Id of workOrderPriority to update
field String: Valid options are title, workOrderPriorityName, sortOrder, enabled
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
# Disable the "Emergency" work order priority (id 9) without touching its other fields
workOrderPriorityId = 9
fieldToUpdate = "enabled"
newValue = False
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
recordsModified, message = system.kanoa.cmms.updateWorkOrderPriorityField(workOrderPriorityId, fieldToUpdate, newValue, currentUserId)
print recordsModified, message