Skip to main content

system.kanoa.cmms.deleteWorkType(workTypeId, userId)

Deletes a work type from the system. The underlying SQL includes a referential-integrity guard: if the work type is still referenced by any existing workOrderEventTechnician entry, the delete will be prevented rather than silently orphaning records.


Parameters

workTypeId Integer: Id of the work type to delete
userId Integer:Id of the user executing the function


Returns

# of records modified Integer
message String None if success


Example

# Attempt to delete the "Design" work type
workTypeId = 4
userId = system.kanoa.security.getIDPUserId({"userName": 'SYSTEM'})
recordsModified, message = system.kanoa.cmms.deleteWorkType(workTypeId, userId)
print recordsModified, message