Dynamics NAV

Menu

I’ve done a few C/AL code merging for Dynamics NAV in the past, and while I don’t mind working with BeyondCompare for a few hours every now and then, the task is repetitive and prone to errors so I was searching for a cleaner and faster approach. A few days ago my boss told me about (NAV) Powershell commands and that I should give them a try. Why not?

I liked the idea of running a few Powershell commands that do the bulk of the job, from merging to compiling an entire database with minimal assistance on my side. The less “personal touch” the better. Less time spent on redundant tasks lead to less mistakes, and more time for development and trying new technologies.

And this is where I am now. The process still requires (minimal) developer’s interaction – for updating standard objects (VersionList propery) touched by AddOns objects, comparing a few conflict files and of course, running the commands. Albeit all this, the time I recorded to apply a cumulative update is at the minimum halved. Is there room for further improvement? Definitely, with a few more experiments under the belt and testing, the process can further be refined into a single script run, cutting 4-6 hours task to a few minutes.

The steps below are based on a recent task I worked on: to apply standard NAV 2016 CU11 on top of a NAV 2016 CU5 database + my employer AddOn.

Pre-requisites:

A previous CU demo database (the last one you applied) – let’s call it CU(n-1)

The current (the one we want to apply) CU demo database – named here CU(n)

3. Merge code using BeyondCompare or any other similar tool comparing files from ConflictModified folder against correspondent files from ConflictTarget folder. Copy the merged files(overwrite existent) into the Result folder.

4. In your current database(target db) Development Environment select all standard objects that have been touched by your AddOns

5. Take each object of the list in Development Environment and manually add your AddOn version into the correspondent files from RESULT folder

Note: This is because the -VersionListProperty parameter of Merge_NAVApplicationObject cmdlet does not update the version list with the AddOn signature – need to do it manually for now.