Automated version management? Of course!
Imagine that whenever you edit an object in C/SIDE Object Designer, and save it, the system automatically saves it in the version history. Imagine that it never simply overwrites your previous version, but keeps all of them there for you. Imagine that you can see all of the modified versions of any object, then make any version the current version by doing as much as a single mouse-click, no tedious imports and exports needed. Imagine that this is true for all of the developers on your team. Imagine that it is completely, fully automated.
They say a picture is worth a thousand words. So, imagine your Object Designer look like this:
Microsoft Dynamics NAV integrated C/SIDE development environment leaves a lot to be desired, with version management being close to the top of the most wanted features list. Now you can have it. Download it here.
(Two notes on the download file. First, it is .doc, and I am sorry about it. WordPress doesn’t allow me to post .zip files, so I had to do a workaround: I created a doc file and embedded two other files in it. Second, the disclaimer on the main page of the blog is here, and it applies to this blog post as much as any other: this is provided AS IS, with no warranties, and no rights, so use this at your own risk. Not that I want to scare you off.)
What is this stuff? As my intro tries to convey, this is a simple utility which can do automated version management for you. It employs a single simple mechanism to allow you to keep all of the previous versions of the object whenever a user saves it in Object Designer. For every single object that was ever changed, all of the versions (from the moment this tool was put in place) are kept in the Object Versions list, so you can review all of the changes and then by a click of a mouse replace the currently active version of an object with any of its previous versions in the history list. Simple.
The tool works only with SQL Server 2005 (it can be easily adapted to work on SQL Server 2000, too), does not work with native Database Server, and consists of the following:
-
SQL Server trigger which is used to update your object version history every time you update an object.
-
A global table (data per company = no) called Object Version, which is basically a copy of the table Object, with some more fields to specify the version number, the user who did the modification and whether the version is active or not.
-
A form which looks exactly like Object Designer, except for New, Design and Run buttons, but with subform which lists all existing versions for the object selected. There is also a function Restore, which replaces currently active version with the selected version, while maintaining both versions in the database so no version is ever lost.
To install this tool, you need to follow these two steps:
-
In the provided doc file, open the Version Management.txt file, save it to the file system.
-
Open Microsoft Dynamics NAV, connect to the database you want to use this feature with, then open the Object Designer.
-
Import the file saved in the first step.
-
In the provided doc file, open the Version Management – SQL Trigger.txt file, copy the contents to the clipboard.
-
Start SQL Server Management Studio, connect to the Microsoft Dynamics NAV database you want to use this feature with, then click the New Query button.
-
Paste the contents from the clipboard, and execute the script.
-
That’s all folks.
To test the functionality, open a form in the updated NAV database, then save it. Then run form 94092 Object Versions and locate the object you modified. When you found it, note that version history in the bottom part of the form contains your saved version. Now you go to the same form you modified, modify it again, this time adding a button to it, then save it. In the Object Versions history you can see that now you have two versions, and that second version is active. Select the first version, click Functions, Restore, and confirm the message. At that point, your previous version of the object is restored, but the second one is kept in the history as well. You can confirm that your original version is kept by running (or designing) the form, and noticing that the button you added is not present there.
There are some known issues with this first version:
-
It doesn’t store initial versions of objects existing at the time the utility is put in place. It stores every new version. To make it store all objects, you can loop through all objects and do a dummy update (calling modify with changing nothing), it would save all initial versions for you.
-
It doesn’t keep the true SQL login or Windows AD user name, it simply keeps dbo or application role name. It can be changed by some modifications to the SQL trigger, but I was too lazy to do this for the first version, and too excited to post this as soon as possible.
I don’t recommend using this trick in production environment, both because it is not really useful there (in case you have good deployment procedures in place and your customer doesn’t have access to Object Designer), and because it works by employing a mechanism outside Microsoft Dynamics NAV. However, in any development environment, I am sure it can save hours, if not days, of work.
Please let me know if this worked for you, and what you think of this. I hope you find this as useful as I think it might be.

Loading comments…