You must not delete a hierarchy if you already have relationship records that use the hierarchy.
If your relationship object uses the hierarchy code column instead of the rowid column and you have records in that relationship object for the hierarchy you are trying to delete, you will get an error.
To delete a hierarchy:
In the Hierarchies tool, acquire a write lock.
In the navigation tree, right-click the hierarchy that you want to delete, and choose
Delete Hierarchy
.
The Hierarchies tool prompts you to confirm deletion.
Choose
Yes
.
The Hierarchies tool removes the selected hierarchy from the list.
You are allowed to delete a hierarchy that has relationship types associated with it. There will be a warning with the list of associated relationship types. If you choose to delete the hierarchy, all references to it will automatically be removed.