Skip to main content

system.kanoa.cmms.updateMaintenanceSubTypeField(maintenanceSubTypeId, field, value, userId)

Updates a single named field on an existing maintenance sub type record, identified by maintenanceSubTypeId. Unlike updateMaintenanceSubType (which requires the full set of fields), this function updates only the one column named in field, setting it to value.


Parameters

maintenanceSubTypeId Integer: Id of maintenanceSubType to update
field String: Valid options are title, maintenanceSubTypeName, maintenanceTypeId, 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

# Update just the name of an existing maintenance sub type
maintenanceSubTypeId = 14
field = "maintenanceSubTypeName"
value = "Belt Replacement"
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
recordsModified, message = system.kanoa.cmms.updateMaintenanceSubTypeField(maintenanceSubTypeId, field, value, userId)
print recordsModified, message