Skip to main content

system.kanoa.cmms.updateWorkOrderStatusField(workOrderStatusId, field, value, userId)

Updates a single named field on an existing work order status, identified by workOrderStatusId, without requiring the rest of the record's values to be resupplied. Use this for quick, targeted edits � such as flipping a status's enabled flag or bumping its sortOrder � instead of updateWorkOrderStatus, which requires the entire statusInfo dictionary.


Parameters

workOrderStatusId Integer: Id of workOrderStatus to update
field Object: Valid options are workOrderStatusName, 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

workOrderStatusId = 3
field = "workOrderStatusName"
value = "Closed"
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})

recordsModified, message = system.kanoa.cmms.updateWorkOrderStatusField(workOrderStatusId, field, value, userId)
print recordsModified, message