Remove Orphan Records

We created this tool to clean up orphan records. These are records that don't have their parent refs to either site,floor,equip or other navTree hierarchy level refs. They are hidden floating around in your database. Having these orphans in your database can lead to programs not writing, points not commanding, consuming CAPs and other issues. An example of how orphan records can occur is when a user would delete a site via folio. By deleting a site via folio, it only deletes that specific record and not the child objects below it. In that case, the floor, equips, and points that were under that site would be orphans because they no longer have a valid siteRef. They would no longer be visible in the DB Tree because what they are referencing no longer exists. The user can either fix this or delete them using the tool.

  • Orphans will show these error messages: 'Missing nav ancestor tag' & "Unknown rec for '(level)Ref' reference."
  • Orphan error messages can be found in the lint messages under info or by running 'lint()' in folio.
  • By querying floor/equip/point in folio, the display name would appear with an id in the front like in the below screenshot. That is an indication that its an orphan.

How to use the Remove Orphan Records tool

1. The user will have to select on the Folio application which is under the Advanced Apps

2. Once Folio has launched, the user can select on the Tools button  located on the right

  • In the tool list, navigate towards the following: Database Clean Up > Remove Orphan Records

3. Once the user selects it, they will be prompted with a count of how many orphan records were found at the highest level in the hierarchy if any were found.

  • They can then decide to remove them or not. 
  • If 0 is returned, then you're database is clean and doesn't have orphan records.

4. If you do have orphan records and decided to remove them, in folio run this query after: folioEmptyTrash()

5. Then run the Remove Orphan Records again to see if there are any more. If there are, remove them and repeat until 0 is returned. Need to do this multiple times depending on how high in the hierarchy you have orphans. It works on one level at a time starting at the top.