How to merge application objects using the example script in Dynamics NAV?

Tagged: 

This topic contains 2 replies, has 3 voices, and was last updated by  Locus IT 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #20642

    Deepak
    Participant

    How to merge application objects using the example script in Dynamics NAV?

    #21054

    Locus IT
    Participant

    Hello Deepak,

    The Dynamics NAV product media includes a folder with examples of how you can use Windows PowerShell cmdlets to compare and merge application objects. In the WindowsPowerShellScriptsfolder on the product media, the ApplicationMergeUtilities folder contains Windows PowerShell sample scripts and folders that contain demonstration data.

    You can run the sample scripts from the Microsoft Dynamics NAV Development Shell. Alternatively, you can use the Windows PowerShell Integrated Scripting Environment (ISE) as described in the following section.

    The individual scripts provide different variations of how you can use the Dynamics NAV cmdlets. For example, the HowTo-Merge-N-Conflicts-External-Tools.ps1 script shows different ways of displaying conflicts. By opening the scripts in the Windows PowerShell ISE, you can examine the different variations and decide how you want to use the cmdlets to upgrade and maintain your own application.

    Using the Sample Scripts in the Windows PowerShell ISE

    If you want to use the Windows PowerShell ISE, you must you must import the Microsoft.Dynamics.Nav.Model.Tools.psd1 module. The module installs to the equivalent of C:\Program Files (x86)\Microsoft Dynamics NAV\100\RoleTailored Client when you choose the Developer option in Microsoft Dynamics NAV Setup.

    For example, you can import the module into the Windows PowerShell ISE by typing a command such as the following:

    Import-Module "${env:ProgramFiles(x86)}\Microsoft Dynamics NAV\110\RoleTailored Client\Microsoft.Dynamics.Nav.Model.Tools.psd1" -force  
      
    Get-Help "NAV"  
    

    Now you can see the Help for the cmdlets and take a closer look at the examples for how to use them.

    The ApplicationMergeUtilities folder contains four subfolders that can help you start working with the scripts. The demonstration data in the ORIGINAL, MODIFIED, and TARGET folders illustrate the text files that are the input to the cmdlets. The demonstration data use separate text files for each application object, but you can configure the text files in a way that works better for you. For example, you can use the Join-NAVApplicationObjectFile cmdlet to combine all the text files in the MODIFIED folder in a single file, for example, before you run the script.

    The HowTo-Start-Import-NAV-Module.ps1 script imports the Microsoft.Dynamics.Nav.Model.Tools.psd1 module into the Windows PowerShell ISE. The __Run-Application-Merge-Utilities.ps1 and __Reset-HowTo-Sample.ps1 scripts enable you to run the sample scripts repeatedly.

    For Help for a Dynamics NAV cmdlet, type Get-Help <cmd name>. For Help for the Windows PowerShell ISE, press F1, or choose the Help menu, and then choose Windows PowerShell ISE Help.

    #20648

    Paul
    Participant

    Hello Deepak,

    The Business Central product media includes a folder with examples of how you can use Windows PowerShell cmdlets to compare and merge application objects. In the WindowsPowerShellScripts folder on the product media, the ApplicationMergeUtilities folder contains Windows PowerShell sample scripts and folders that contain demonstration data.

    You can run the sample scripts from the Dynamics NAV Development Shell. Alternatively, you can use the Windows PowerShell Integrated Scripting Environment (ISE) as described in the following section.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Skip to toolbar