I had to update this post a little bit, see below for the details, but the killer feature had to go 🙁
First, a disclaimer: THIS IS PROVIDED AS IS, WITHOUT ANY WARRANTIES, AND YOU USE THIS AT YOUR OWN RESPONSIBILITY. All other disclaimers here on this site apply as well. Now that we are over with legal yadda-yadda, let’s get down to facts.
What’s new? A lot.
- Initialization: Before you can use the tool, you must call Initialize Version Management function, which makes a default version out of each object.
- Check In / Check Out functionality: Objects can’t be modified by any user, unless that user has first checked out the object. If an object is checked out, only the user who has checked it out can save it. Other users can’t save it. New objects can be created at any time, but for any consecutive changes, you must check out the object first. You must check objects out for deletions, as well as for restoring previous versions.
- Cancel Check Out: Object which has been checked out can be reverted to the last checked-in state by simply calling Cancel Check Out. Any saved changes will be rolled back.
- And a big fat cherry on top: For a true collaborative development, an extra feature is there – a user who has checked out an object can save it as many time as they want – it won’t affect other users until the object is checked in. For example, Johnny checks out Codeunit 80, and starts making changes. Any changes that Johnny does, will be visible only to him. If Jenny looks at Codeunit 80, she will se the latest checked in version. Only after Johnny checks in the Codeunit 80, Jenny will see the changes made by Johnny. Ok, this doesn’t work with tables – have to figure out how to handle tables the best possible way, but with other objects, it works ok.
[Update] Unfortunately, I had to drop this last feature, because it simply can’t be made to work with tables. Any table change subsequent to the initial table creation would simply not update the underlying SQL Server table object, so I had to change this and upload the updated version – it has everything, but this.[/Update]
Ok, for this last gimmick I had to do some ugly hacks to the database: rename the Object table to Object (NAV), then create a view called Object over the Object (NAV) table. This view selects the latest modified version for the user who checked the object out, and checked in version for all other users. There is a bunch of INSTEAD OF triggers over this view to make this possible. Now – I can’t tell whether this will work in 100% of situations, so before you decide to do anything with this – check it first, on an empty Cronus database. It worked for me, without any problems, on two different databases. NEVER EVER USE THIS IN ANY PRODUCTION ENVIRONMENT.
Of course, all functionality from previous versions, such as the possibility to restore a previous version, is still there. Also, thanks to suggestions from many users, the tool now correctly displays user name. I also had a suggestion to implement the Restore As functionality, but this would require some more tricks with SQL Server, it will come in a future version.
To install this tool, simply download the [Update]Version Management 2.01 file, rename it from .doc to .zip [/Update] (unfortunately, WordPress doesn’t allow me to upload anything else), it contains all the files embedded. Then first import the objects into NAV, then execute the SQL script in the context of the database which you want to have version managed.
If you have any questions, please feel free to ask them here, I’ll be happy to answer. Also, if you find any bugs, let me know!