Skip to main content
1-Visitor
March 16, 2015
Solved

Cannot delete a State that has no references

  • March 16, 2015
  • 1 reply
  • 1681 views

How can I delete a state which is no longer needed nor is it used. All references to i have been deleted.

Here is what I've tried in CLI:

im deletestate --hostname=mks state_name

Deleting state...

Submitting...

Delete state state_name? [yn](n): y

State "state_name" cannot be deleted because it is still being referenced and a database constraint will not allow it to be deleted. If Items have been created that reference this State, you will not be able to delete this State until you deleted those Items. If this state is referenced by admin objects, you can find where it is being referenced by viewing the State and selecting the Refences tab.

The References tab display no references.

When I try to view references view CLI:

im viewstate --hostname=mks --showreferences state_name

-------------------------

Created by user_name (user_name) on Jul 19, 2004 1:02:41 PM

Modified by user_name (user_name) on Jun 4, 2014 8:12:00 AM

State: state_name

Description:

Blah Blah

Image: none

Position: 120

Capabilities: none

References:

-------------------------

    Best answer by JoeBartlett

    You would need to query for them using the History (by value) condition.

    Query1.png

    Query2.png

    1 reply

    21-Topaz I
    March 16, 2015

    Hi Dan,

    The error message does indicate that if there are historical references (in item history) then you have to delete those items before you can delete the state. This is often the case if it complains about references but the References tab or --showreferences flag return no results.

    DanR.1-VisitorAuthor
    1-Visitor
    March 16, 2015

    How would I be able to find those historical references?

    21-Topaz I
    March 16, 2015

    You would need to query for them using the History (by value) condition.

    Query1.png

    Query2.png