Skip to main content

Application Merge Utilities - How to Use - Compare & Update NAVApplicationObject.

Hi All,

This is Fifth Post in this series. If you would like to read earlier post please visit Index of Application Merge Utilities.

As Promised In This Post we will see about Next Two Commands Available in the the Module "Microsoft.Dynamics.Nav.Model.Tools".

1. Compare-NAVApplicationObject
2. Update-NAVApplicationObject


Let's Load the Module again and see the Available Functions.
---------------------------------------------------------------------------
Import-Module "${env:ProgramFiles(x86)}\Microsoft Dynamics NAV\71\RoleTailored Client\Microsoft.Dynamics.Nav.Model.Tools.psd1" -force
Get-Help "NAV"
---------------------------------------------------------------------------

For the Post i Need Two Files To Compare and a Third File to Apply the Result of Comparison.
So These are my Three Files -

I Will Compare these Two - 
NAV2013 W1 All Objects Initial Set (NO Cumulative Update).
NAV2013 W1 All Objects with Cumulative Update 17.

And Apply Change into - 
NAV2013 IN All Objects Initial Set (NO Cumulative Update).

What i want to achieve with this exercise is -
Merging of Changes From W1 Latest Cumulative Update to Indian Standard Database.

1. Compare-NAVApplicationObject =

This cmdlet will Compares text files with Microsoft Dynamics NAV application objects and then calculates the delta between the two versions. The result of the comparison is a number of text files with the calculated delta. The deltas can later be applied to a third version by using the Update-NAVApplicationObject cmdlet.

DELTA is the Difference Between Two Files. A picture might help at this moment.



Below are the files that i will use for the Demo -



This Cmdlet have Following Input Parameter 


  • Original - Specifies the application objects that are the baseline of the file comparison.
  • Modified - Specifies the application objects that you want to compare to the original version.
  • Delta - Specifies the folder where the result of the comparison between the two versions of application objects must be put. 

  • Force -Forces the cmdlet to overwrite any existing files in the Delta folder.
  • Legacy - Reduces the scope of the cmdlet. Do not set this parameter.
  • NoCodeCompression - Specifies if the files that are the result of the comparison must not be compressed.
  • PassThru - Specifies if the cmdlet must return a FileInfo object for each .delta file that is created by the comparison. If you do not set this parameter, the cmdlet returns a list of the files.

------------------------------------------------------------------------------
Compare-NAVApplicationObject -Delta C:\TEMP\Result -Modified C:\TEMP\NAV_2013_W1_With_rollup_17.txt -Original C:\TEMP\NAV_2013_W1.txt -Force -PassThru
------------------------------------------------------------------------------

Below is the Cmdlet window.


Here is the processing happing when i run the commandlet.


Here is the output of the Cmdlet -


You can open the Delta File Created as output in Notepad if you want to have a look.

Now let's see the counterpart of this Commandlet i.e Update-NAVApplicationObject .

2. Update-NAVApplicationObject  == 

This cmdlet will Applies a set of deltas to the specified application objects. The files that describe the delta are generated by the Compare-NAVApplicationObject cmdlet.

This Cmdlet have following Parameters -

  • Delta - Specifies the folder where the result of the comparison between two versions of application objects are stored.
  • Result - Specifies the folder where the updated files must be stored.
  • Target - Specifies the folder where the application objects are stored that you want to update with the delta.
  • DateTimeProperty -Specifies the value of the Date and Time properties for the updated application objects. The default value is Now.
  • DocumentationConflict - Specifies how conflicting lines in documentation triggers are merged. Set this parameter when you are merging objects with the same type of content in the documentation trigger, such as technical descriptions or a version list. The default value is ModifiedFirst.

  • Force - Forces the cmdlet to overwrite any existing files in the Result folder.
  • Legacy - Reduces the scope of the cmdlet. Do not set this parameter.
  • ModifiedProperty - Specifies the value of the Modified property for the merged application objects.
  • PassThru - Specifies if the cmdlet must return a FileInfo object for each merge operation. If you do not set this parameter, the cmdlet returns a list of the files.
  • VersionListProperty - Specifies if you want to update the Version List property for the application objects.

------------------------------------------------------------------------------
Update-NAVApplicationObject -Delta C:\TEMP\Result -Result "C:\TEMP\Final Merged Result" -Target C:\TEMP\NAV_2013_IN.txt -DateTimeProperty FromModified -DocumentationConflict ModifiedFirst -ModifiedProperty FromModified -VersionListProperty FromModified
------------------------------------------------------------------------------

Below is the Cmdlet windows of the Cmdlet.


Below is the Processing Window.



Below is the output of the Commandlet and Merged Files.


Now using the Merge-NAVApplicationObject we can merge the file and import same on NAV 2013 IN Database.


As shown in above picture the Conflicts in Text File are in Below Listed Format -

{>>>>>>>} ORIGINAL
{=======} MODIFIED
{=======} TARGET

Let's try to understand them.

{>>>>>>>} ORIGINAL = Your Base Application Code.
                                              IN MY Case its code from NAV 2013 W1

{=======} MODIFIED = Your Modified Application Code.
                                             IN MY Case its code from NAV 2013 W1 with Rollup 17.

{=======} TARGET =  Your Target Application Code.
                                          IN MY Case its code from NAV 2013 IN.

The Best part is after importing the objects in IN Database when we try to compile the objects. All Objects having Conflict in Code segment will not get compiled due to above tags. 

** BUT Remember to visit the conflict files as there might be changes related to properties or Option Strings which does not have these Tags and will get compiled without any issues. So do Visit the Conflict File.

Sample conflict (Not Identified during Compilation)-



So this is what we achieved after running the two command lets.


I would still love to use the last commandlet for Merging Gaps between Objects and same is suggested by Microsoft ins-ted of this two step procedure. We will discuss same in Next Post.

Hope some of you will be find the article useful.

Stay Tuned for More..

Regards,
Saurav Dhyani
saurav-nav.blogspot.com

Comments

Popular posts from this blog

VIEW SERVER STATE permission on SQL Server?

Hi all, Sometime While trying to Login into a database we face an error message as shown below. --------------------------- Microsoft Dynamics NAV Classic --------------------------- You cannot start Microsoft Dynamics NAV Classic because you do not have the VIEW SERVER STATE permission on SQL Server. Contact your system administrator. --------------------------- OK    ---------------------------

RTC Report It is not possible to instantiate the Visual Studio bridge.

Hi all, As a Navision developers I have Multiple Versions of Navision running in single Machine. As discussed Earlier in the post how to run multiple Version of RTC in single machine. So my machine have following details for RTC Versions - NAV 2009 R2    - is installed. NAV 2009 SP1  - is copied at C:\Program Files (x86)\Microsoft Dynamics NAV\60\NAV 6.0 SP1 IN\ NAV 2009         - is copied at C:\Program Files (x86)\Microsoft Dynamics NAV\60\NAV 6.0 IN\ This approach has been working great for execution of Classic and RTC Clients. However, after installing Dynamics NAV 2009 R2, if i tried to view the Layout for an NAV 2009 SP1 Report i was getting the following error: ---------------------------  Microsoft Dynamics NAV Classic  ---------------------------  It is not possible to instantiate  the Visual Studio bridge.  ---------------------------  OK    --------------------------- After searchi...

NAV 2013 R2 - Cumulative update 12 Released.

Hi all, Please find below the details of  Cumulative Update 12 released for Microsoft Dynamics NAV 2013 R2. Title - Cumulative Update 12 for Microsoft Dynamics NAV 2013 R2 Build No. - 38053 Release Date - October, 2014 Local Version Included - AU, AT, BE, CH, DE, DK, ES, FI, FR, IS, IT, NA, NL, NO, NZ, SE, UK, RU Download Link Note: Implementing this cumulative update will require a database conversion unless you have already implemented update rollup 5.