system.kanoa.cmms.updateMaintenanceSubType(maintenanceSubTypeInfo, userId)
Updates a maintenance sub type. All maintenanceSubTypeInfo keys are required unless otherwise stated
Parameters
maintenanceSubTypeInfo Dictionary
| - enabled | Boolean | Not required. Set to True if not passed |
| - maintenanceSubTypeId | Integer | |
| - maintenanceSubTypeName | String | Name of sub type |
| - maintenanceTypeId | Integer |
userId Integer:Id of the user executing the function
Returns
# of records modified Integer
message String None if success
Example
# Update an existing maintenance sub type's name and re-point it to a different parent maintenance type
maintenanceSubTypeInfo = {
"maintenanceSubTypeId": 14,
"maintenanceSubTypeName": "Bearing Replacement",
"maintenanceTypeId": 3,
"enabled": True
}
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
recordsModified, message = system.kanoa.cmms.updateMaintenanceSubType(maintenanceSubTypeInfo, userId)
print recordsModified, message