How to delete obsolete Dynamics NAV objects? (Version 2)

A while ago, I had an issue, where end-user was not able to delete some objects in custom range (50000 – 99999), because objects were not licensed. I have resolved the issue by creating a “killer object”. Which worked fine, because as a developer, I did have access to range 50000 – 99999. So, I was able to delete obsolete objects.

But, as a few commenters pointed out, this approach doesn’t work if you want to delete objects that are not licensed even on a developer’s license. So, what can we do about it?

Well, Stefan has found a way! If we cannot create an object in NAV (because, license file doesn’t permit to do that), we need to turn to SQL. That’s right… we need to do something that we normally advice end-users not to do – change data in SQL side.

All you need to do, is to run a SQL query that would create a record in Object table. For example:

USE [YOUR DEV DATABASE]
GO

INSERT INTO [Object]
(
[Type],
[Company Name],
[ID],[Name],
[Modified],
[Compiled],
[BLOB Size],
[DBM Table No_],
[Date],
[Time],
[Version List],
[Locked],
[Locked By]
)
VALUES
(
YYY,
”,
XXXXXX,
‘DeleteYYY_XXXXXXX’,
0,
0,
0,
0,
‘1753-01-01 00:00:00.000’,
‘1753-01-01 00:00:00.000’,
”,
0,

)
GO

YYY – Object Type (Integer) has these options:
0 – TableData
1 – Table
2 – Form
3 – Report
4 – Dataport
5 – Codeunit
6 – XMLPort
7 – MenuSuite

Use this at your own risk! 🙂

This entry was posted in Dynamics NAV / Navision. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *