Recently, I was asked how to remove obsolete Dynamics NAV objects. Client was trying to delete one old object (I have recreated this scenario on my local CRONUS database to show you an example), but getting error message saying You do not have permission to delete the table:
And, fair enough, the object was not in the licensed range of client’s license. Therefore, I suggested to use Delete Action in the Import Worksheet. However, if you will try to do this, you might get another error message saying Delete is only allowed for empty objects.
So, in order to resolve this issue, what question would you ask next:
- Can we temporarily change license to developer’s license and delete the object?
- Or, can we create an empty object and use “Delete” Action in Import Worksheet?
Well, the next time you will need to remove an obsolete Dynamics NAV object, you will be able to ask the second question (and you will have an answer for it)!
How to create an empty Dynamics NAV object?
Firstly, connect to a database, where this object does not exist (usually, default CRONUS database works really well). Then follow the steps below:
1. In the Object Designer, click on the object type (in our example, we need to delete table, so let’s click on “Table”).
2. Click “Last” button (or Ctrl+End) to jump to the last entry in Object Designer.
3. Click Arrow Down button on the keyboard.
4. Click on the “ID” field and click F2. This will make the field editable. Enter object ID which you need to remove. Also, if you want, you can define the “Name” and other fields.
5. Click Arrow Up button on the keyboard (this will commit the changes to the database and create an empty object).
All you need to do now, is to export the object as a FOB file and import it back to the database where you want this object to be deleted. Then, in Import Worksheet, you will be able to select action “Delete“.
Result! Object gets deleted even if license does not have permissions to access that object ID.