Back

How to delete the complete hierarchy and suggest it again

Master Data in Hierarchies
Video 6/8
Play
Close
  • Helpful
  • Not helpful
  • Needs update
  • Technical error
An advanced video is for the experts, and it requires detailed knowledge about the specific area of Business Central. Advanced Watch "the details", if you need detailed knowledge about a specific topic. These videos are only relevant for particular users. The Details This video includes functionality from the app "Master Data Information" which is available at Microsoft AppSource. Click to visit AppSource. Master Data Information

Playlists  Manage

Log in to create a playlist or see your existing playlists.

Presenter: Sune Lohse, Chief Strategy Officer

If you have made major changes to your master data, re-imported a large number of items, or recreated many master data records, you may want to rebuild the entire hierarchy from scratch. This is possible in Business Central, but the data structure beneath it is complex, so you need to understand exactly what you are deleting before you start.

You cannot delete master data at an arbitrary level. The system only lets you delete from the bottom of the hierarchy upwards. If you try to delete a record that still has data beneath it, you get an error telling you that you can only remove from the bottom of the hierarchy.

To clear everything, follow this order: first delete all fixed master data relations, then delete all master data item relations, then remove the empty master data relations, and finally delete the two top-level records. After that you can re-suggest master data relations, recalculate the item relations, and remove empty relations again to rebuild a clean hierarchy. The only thing you lose are your fixed relations, which you have to recreate manually.

Why you cannot delete master data at any level

The hierarchy is built on a complex data structure with several connected layers. You have fixed records, automatically created master data information, and all your actual master data on top.

Because of this structure, you can only delete from the bottom of the hierarchy. If you try to delete a record higher up while data still exists beneath it, the system stops you. For example, if you try to delete a city bike that has data beneath it, or remove a specification from a specific level, you get an error stating that you can only remove from the bottom of the hierarchy. The same applies if you go into your master data relations and try to remove something at a specific level. This is what makes a full cleanup something you have to handle carefully.

How to delete the full master data hierarchy

If you want to remove everything and start over, follow these steps in order:

  • Delete all fixed master data relations. Enter the fixed master data relations and delete all of them. Remember to clear the filter first so you can see every record, not just a filtered subset.
  • Delete all master data item relations. Go into the master data item relations and delete all of them. If you skip this step, you will not be able to delete the master data relations that have specifications attached to them.
  • Remove the empty master data relations. Refresh the hierarchy and you will see that only the hierarchy itself is left. Remove the empty master data relations. This clears almost everything except the two top-level records.
  • Delete the two top-level records. Go back into your master data relations and delete the two top records. You are now back where you started, with an empty hierarchy.

How to rebuild the hierarchy after deletion

Once the hierarchy is empty, you can rebuild it. Re-suggest the master data relations, recalculate the master data item relations, and then remove the empty master data relations again.

If you refresh the full hierarchy right after the deletion, it shows no items. When you update the item relations and refresh again, all the items reappear. Scroll down and you will find the records that actually contain items. After you remove the empty master data relations one more time, you are left with a clean hierarchy that only includes the structure that actually contains data.

What you lose when you rebuild

The only thing you lose in this process is your fixed relations. Those are not regenerated automatically, so you have to recreate them manually after the rebuild.

Q&A

Why can I only delete master data from the bottom of the hierarchy?

The hierarchy is built on a complex, layered data structure. If a record still has data beneath it, the system blocks the deletion and shows an error saying you can only remove from the bottom of the hierarchy. You have to clear the lower levels first.

In what order should I delete master data to clear the full hierarchy?

Delete in this order: first the fixed master data relations, then the master data item relations, then the empty master data relations, and finally the two top-level records. Remember to clear any filter so you see all records before deleting.

Why can’t I delete the master data relations with specifications?

You first have to delete all master data item relations. As long as item relations still exist, the system will not let you delete the master data relations that carry specifications.

How do I rebuild the hierarchy after deleting everything?

Re-suggest the master data relations, recalculate the master data item relations, and then remove the empty master data relations. After refreshing, the hierarchy will show only the structure that actually contains data.

Do I lose any data when I rebuild the hierarchy?

You lose your fixed relations. They are not regenerated automatically, so you have to recreate them manually after the rebuild.

939465377-LWsO7VV-4nM-ENG24032856