Upgrading the application

We would like to package our application to be easily upgraded to other versions of Microsoft Dynamics NAV. This can either be a new version or a cumulative update. We can also package our software to be implemented in a different localization (country), or even downgrade to an older version of the application.

Creating a Delta file

To ship our software safely between versions, we need to create a Delta file. This defines the difference between our application and the standard application that we started off with when we started programming.

The Delta file allows both the entirely new objects and the changes that we have implemented to the standard Dynamics NAV objects. When the Delta file is applied to another version, we will get a warning if the change cannot be applied because of a conflict or missing reference.

The steps of creating a Delta file

Let's generate the Delta file from our B & B application step by step. To do this, we must use the PowerShell commands that are installed when we install Dynamics NAV 2015. These are as follows:

  1. Creating a base version and folder structure: we need a folder on a drive with three subfolders. We will call the folder BandB. Here, we have a NAV2015 folder that contains the unchanged objects, a Changed folder that contains the Bed and Breakfast objects, and a Delta folder for the Delta files:
    The steps of creating a Delta file
  2. Exporting text files: We need to export the objects from Dynamics NAV as text files. This is something that can be done manually or via PowerShell. For reasons of simplicity, we will do it manually.
    The steps of creating a Delta file
  3. Splitting the objects, and comparing and generating the Delta files: to compare the objects, we need to split the text file into one file per object, and then run the compare. We'll do this using PowerShell, as shown in the following screenshot:
    The steps of creating a Delta file

    Note

    You can find more information at https://msdn.microsoft.com/en-us/library/dn789581(v=nav.80).aspx on how to use PowerShell on MSDN.

Inside the Delta file

According to the PowerShell result, we should have 48 Delta files, 44 inserted objects, and 4 changed objects.

The syntax of a Delta file is similar to normal text objects, and an inserted Delta file is identical to a normal text object.

The changed objects are more interesting, as displayed in the following screenshot:

Inside the Delta file

We can see that the file is a modification to the Customer table. The CHANGES tag describes an insertion of a flow field with ID 84000. This Delta file can be applied to any text file of any version of NAV2009R2 and newer. We can potentially downgrade our solution using the Delta files.

Note

MSDN and the Dynamics NAV team blogs have a lot of articles on using the Delta files and PowerShell. One of them is available at: http://blogs.msdn.com/b/nav/archive/2014/10/03/merging-application-objects-using-windows-powershell-in-microsoft-dynamics-nav-2015.aspx?PageIndex=1

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset