Skip to main content

system.kanoa.cmms.updateMaintenanceType(maintenanceTypeInfo, userId)

Updates a maintenance type. All maintenanceTypeInfo keys are required unless otherwise stated


Parameters

maintenanceTypeInfo Dictionary

- enabledBooleanNot required. Set to True if not passed
- maintenanceTypeColorStringNot required. i.e '#FF000'
- maintenanceTypeIdIntegerId of the maintenance type to update
- maintenanceTypeNameStringName of type
- serialIdIntegerNot 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