When you have developed a NAV App with Microsoft Dynamics NAV functionality, the next step is to wrap your new .TXT and .DELTA files into a .NAVX file, the NAV App packaging format. With the application artifacts goes data describing your NAV App, such as name and version. This topic explains how to easily wrap this up: Define and create your NAV App manifest, and package it all.

To create the NAV App manifest

  1. The NAV App manifest describes characteristics about your app. All characteristics have a parameter in the cmdlet to use, New-NAVAppManifest. These are the data to provide:

    Data Description

    Name

    Specifies the name of the NAV App.

    Publisher

    Specifies the publisher of the NAV App, such as your company name.

    Version

    Specifies the version of the NAV App. The version is a string in the format of Major.Minor.Build.Revision, with a default value of 1.0.0.0 if not provided. The value should be incremented for each new version of the NAV App.

    Description

    Specifies the description for the NAV App.

    Id

    Specifies the unique identifier for the NAV App. A unique identifier will be generated if a value is not provided. The same unique identifier should be used for each new version of the NAV App.

    CompatibilityId

    Specifies the compatibility ID of the NAV App. The compatibility ID is a version string in the format of Major.Minor.Build.Revision, with a default value of 1.0.0.0 if not provided. The value is used to indicate whether there are compatibility related code changes between different versions of the NAV App. If a new version of the NAV App does not break compatibility, leave the compatibility ID the same as the previous version.

    Dependencies

    Specifies the path to a package file (.navx) for another NAV App that this NAV App is dependent on. Use a comma (,) to separate the paths to multiple .navx files., such as in the following example: C:\Proseware\SmartAppBase.navx, C:\Proseware\ProsewareBase.navx

    Prequisites

    Specifies the objects that must exist in order to deploy the NAV App to a Microsoft Dynamics NAV Server instance. The prerequisites is a string in the format of type=ID, where type can be any NAV object type such as Table, CodeUnit, or Page. Use a comma (,) to separate the prerequisites, such as in the following example: Table=397, CodeUnit=78.

    The New-NAVAppManifest cmdlet creates an in-memory Manifest object.

     Copy Code
    New-NAVAppManifest -Name "Proseware SmartApp" -Publisher "Proseware, Inc." -Version "1.5.0.12"

    You can either persist this object to a file and then check it in to source control (New-NAVAppManifestFile), or you can pass it directly to the (New-NAVAppPackage) as described in the next step.

     Copy Code
    New-NAVAppManifest -Name "Proseware SmartApp" -Publisher "Proseware, Inc." -Version "1.5.0.12" | New-NavAppManifestFile -Path proseware.xml

    Related cmdlets are Get-NAVAppManifest and Set-NAVAppManifest , to get more information use Get-Help in the Microsoft Dynamics NAV 2017 Development Shell.

    Tip
    For any Windows PowerShell cmdlet, you can get help and sample usages, such as the following command:

    Get-Help Set-NAVAppManifest -Examples

Next, you can choose to include permission sets in your package. This is optional, but at a minimum , a NAV App must include one permission set that grants permission to use the objects contained in the app. An administrator must map users this permission set ID once it has been imported.

To retrieve permission sets for the NAV App

  1. Use the Export-NAVAppPermissionSet cmdlet to export any permission sets that you have created for the app as shown in the following example.

     Copy Code
    Export-NAVAppPermissionSet -ServerInstance DynamicsNAVServer -Path ProsewarePerm.xml -PermissionSetId 12
    Caution
    If you do not include a permission set with your NAV App, only users with the SUPER permission set will be able to use the app..

Once you have the DELTA and TXT files for your app created you can now complete the final step and build the NAV App package file. NAV App packages require a manifest and access to the application objects you created.

To build the NAV App package

  1. Use the New-NAVAppManifest New_NAVAppPackage cmdlets to build the manifest and package.

    The following is an example on how to create a new NAV App .NAVX package file with a new manifest.

     Copy Code
    New-NAVAppManifest -Name "Proseware SmartApp" -Publisher "Proseware, Inc." -Version "1.5.0.12" | New-NAVAppPackage -Path MyNAVApp.navx -SourcePath APPFOLDER

    Alternatively, if you created a NAV App manifest file, you can use directly from that file:

     Copy Code
    Get-NAVAppManifest -Path '.\Manifest-Proseware SmartApp.xml' | New-NAVAppPackage -Path MyNAVApp.navx -SourcePath APPFOLDER 

    You now have a NAV App packaged, ready to be published and installed on a target server.

    Note
    The packaging process adds a description to the NAV App to the manifest, such as whether it changes pages or adds tables. While not explicitly being enforced currently, this can be used to determine whether to install a NAV App, or not. Use Get-NAVAppManifest -Path to see capabilities.

Finally, you can choose to get your NAV App codesigned. A NAV App package file can be signed to help validate its authenticity. Code signing is a common practice for many applications. For more information, see Authenticode in the MSDN Library.

See Also