Not extremely important to the conversation but I'm not sure how you suppress the canDelete method with code which is where this error is thrown. You could delete it via other ways (such as SQL) but then you need to make sure you purge all the other objects too (such as CLASSSPECUSEWITH). Also, as Mark mentioned, integrity is the most critical thing when it comes to developing inside of Maximo. I couldn't count the amount of issues I've seen where someone did something they knew wasn't supported (thinking what's the harm?) and broke processes in strange ways.
CLASSUSEWITH is used for determining if a classification is used to determine if it can be deleted. By deleting the CLASSUSEWITH reference, you'll be allowed to delete the classification even if it was used on records. As an example, in a demo environment there is a classification ROLLER (BEARING\ROLLER) that is associated to 3 items. Try to delete it and it will fail. Remove the classusewith entry and now you can delete the entire classification even though it was referenced on records. So now you have to figure out what might break on a record that has an orphaned classstructure record.
------------------------------
Steven Shull
Director of Development
Projetech Inc
Cincinnati OH
------------------------------
Original Message:
Sent: Thu June 17, 2021 10:13 AM
From: Peter Domankuš
Subject: Autoscript to delete record: Ignore rules?
Sure. I do not recommend deleting tickets, workorders, classifications and many more such records 'cause there are various relations between those records and other records.
But I still consider Use With relation for classification a low to no risk. Prove me wrong if you don't agree.
------------------------------
Peter Domankuš
Original Message:
Sent: Thu June 17, 2021 09:14 AM
From: Mark Robbins
Subject: Autoscript to delete record: Ignore rules?
Maximo is blocking this because the action is deliberately corrupting the database.
The automation script should not be able to delete the entries - and it sounds like you are seeing an error preventing it.
You may not encounter problems now but you are likely to experience problems in the following situations:
- Opening/manipulating the record which references the deleted data
- Duplicating the record e.g. for a new one to use
- Upgrading the database
- BIRT reports that uses the value as a lookup
------------------------------
Mark Robbins
Support Lead/Technical Design Authority / IBM Champion 2017 & 2018 & 2019 & 2020 & 2021
Vetasi Limited
https://www.linkedin.com/pulse/maximo-support-advice-from-non-ibm-engineer-article-mark-robbins/
Original Message:
Sent: Thu June 17, 2021 01:22 AM
From: User1971
Subject: Autoscript to delete record: Ignore rules?
For what it's worth, I'm just trying to explore my theoretical options in a non-Prod environment. I want to learn what can be done in POCs. Not what should be done. That's a different story. For this particular scenario, I may very well go with a different option -- a custom classification ACTIVE? field and security group. But right now, I'm curious about deleting low-risk records via autoscripts, instead of directly in the DB.
Thanks.
#AssetandFacilitiesManagement
#Maximo