system.kanoa.cmms.updateMaintenanceType(maintenanceTypeInfo, userId)
Updates a maintenance type. All maintenanceTypeInfo keys are required unless otherwise stated
Parameters
maintenanceTypeInfo Dictionary
| - enabled | Boolean | Not required. Set to True if not passed |
| - maintenanceTypeColor | String | Not required. i.e '#FF000' |
| - maintenanceTypeId | Integer | Id of the maintenance type to update |
| - maintenanceTypeName | String | Name of type |
| - serialId | Integer | Not required. Uses maintenanceWorkorder serial Id if not set |
userId Integer:Id of the user executing the function
Returns
# of records modified Integer
message String None if success
Example
# Update an existing maintenance type's color and confirm it stays enabled
maintenanceTypeInfo = {
"maintenanceTypeId": 3,
"maintenanceTypeName": "Mechanical",
"maintenanceTypeColor": "#FF0000",
"enabled": True
}
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
recordsModified, message = system.kanoa.cmms.updateMaintenanceType(maintenanceTypeInfo, userId)
print recordsModified, message