Skip to main content

system.kanoa.tooling.deleteTool(toolingAssetId, retireIfUsed, userId)

Deletes a tool that was never used, with its own setup (tooling info, positions, counters, cycle and item rates, compatibility rules, status). A tool that was used (mounted or held an insert, has life counts or adjustments, rated a run, is on a check event or check sheet, has a work order, or has assets under it) is refused with a message starting 'Has history:' that says what it has. With retireIfUsed, such a tool is set Retired and disabled instead, keeping its history; that is refused while it's mounted.


Parameters​

toolingAssetId Integer: The tool

retireIfUsed Boolean: Retire and disable a tool that was used, instead of refusing. Default False

userId Integer: The user making the change


Returns​

('deleted' or 'retired', message)


Example​

toolingAssetId = 1
retireIfUsed = True
userId = 5
result1, result2 = system.kanoa.tooling.deleteTool(toolingAssetId, retireIfUsed, userId)