Search code examples
sql-servermicrosoft-dynamicsnavisiondynamics-nav-2009microsoft-dynamics-nav

Microsoft Dynamics NAV 2009 How to remove objects outside of license?


During an upgrade process from 2009 to 2016 I'm trying to remove objects relating to an old discontinued product. The objects are not within the range of or license and consists of both Forms, Tables and Reports. When deleting I'm faced with the well known error:

"You do not have permission to delete the '[object name]' Table."

I've tried with my developers license and the customers license with no luck. Since the product is no longer existing there is no use keeping these objects around and I need them gone for the upgrade process.

What is the best approach or technique when deleting objects that's not in the license?

UPDATE: How this issue was resolved? I got in contact with the product owner and explained my problem. They sent me a neat PowerShell script to run. This worked like a charm. Reading through the script I can see that it's using the SQL cmdlets to select and delete relevant data from the following SQL tables:

Objects, Object Metadata, Object Metadata Snapshot, Object Tracking, Object Translation, Permission.

This was the preferred method of the product owner who used to develop this product. It should be applicable to all NAV objects. I have not yet successfully tried one of the answers below (more tries to come). Hopefully this new information will provide someone with enough knowledge to provide a good answer.


Solution

  • The way which was successfully used by several people but for sure cannot be recommended for production system is to simply delete these objects via SQL from Object and supplemental tables. In case of tables, you would need to manually delete the SQL table itself as well as its VSIFT views.

    A bit more better (probably) way is to change the number of the object via SQL and then delete the object via NAV.

    The best way is to use the functionality of "killer objects" - which allow to delete objects via FOB import:

    http://navisionary.com/2011/11/how-to-delete-bsolete-dynamics-nav-objects/

    If you find the partner who can provide you with such killer objects (they need to have a license to create objects in needed range), it solves you problem in a "clean" way.

    If not, you may want to consider creating empty objects in 50000 range in some test DB, changing their number to obsolete range via SQL, exporting them as FOB, and then importing them to your target DB with "Delete" option.