NAV Apps are created in a series of steps each building on the previous one until you have a completed NAV App package. Unlike the familiar development and deployment of Microsoft Dynamics NAV functionality, building a NAV App relies on the exported version of an application to .TXT files. You can export the application from the development environment, use the development environment commands, or use the Windows PowerShell cmdlet that is available in the Microsoft Dynamics NAV 2017 Development Shell, Export-NAVApplicationObject.

Tip
Recommendation: We recommend that you create a folder structure that can be leveraged by the cmdlets that you will use when you package your NAV App. That structure should contain folders for the ORIGINAL object files, MODIFIED object files, and DELTA files. These names match those used as parameters in the application merge utilities. For more information, see Comparing and Merging Application Object Source Files.

To create a NAV App

  1. Establish the BASE as TXT files.

    1. Your NAV App base is just the exported .txt files of the objects you are modifying. You can export just the objects modified objects, or you can export the entire Microsoft Dynamics NAV application. In the Microsoft Dynamics NAV 2017 Development Shell, the Export-NAVApplicationObjectLanguage cmdlet can automate this process or you can use the export functionality in the development environment. The following example uses this cmdlet to export objects to establish the base for the planned modifications.

       Copy Code
      Export-NAVApplicationObject -Path ORIGINAL -DatabaseName MyDatabase -DatabaseServer MyDatabaseServer
      Important
      Objects must be exported as .TXT files. The .FOB file format is not supported for developing NAV App..

      If you use a source control system, you may want to pull the base .TXT files from there.

  2. Create functionality in the development environment.

    1. Use the development environment as usual to create new objects or modify ones to the extent your license allows you. Do keep in mind the simple rules already mentioned:

      • DO NOT make C/AL code modifications
      • DO use subscribing to events to execute code. For more information, see Adding code to NAV Apps using C/AL Events.
      • DO NOT create new or modified XMLPorts, Queries, or Report. For more information, see NAV App Capability Support Matrix.
      • DO NOT change restricted page and table properties. For more information, see NAV App Capability Support Matrix.
    2. Test your application including the NAV App additions, then proceed to the next step.

  3. Export your changed and added application objects to TXT files.

    1. Export all objects that you added or modified to TXT files. Use the same export cmdlet from step 1 or manually export within the development environment. They must also be exported as .TXT files and should be placed in a separate directory so that the packaging process can be pointed at them.

       Copy Code
      Export-NAVApplicationObject -Path MODIFIED -DatabaseName MyDatabase -DatabaseServer MyDatabaseServer
  4. Create DELTA files using the Microsoft Dynamics NAV 2017 Development Shell cmdlets.

    1. NAV Apps are built on the foundation of application object deltas. Again, you use the application merge utilities in the Microsoft Dynamics NAV 2017 Development Shell to distil the changes in the form of application object differences that are stored in DELTA files. Creating a NAV App uses many of the same concepts and tools as you know from application object deltas. You use the Compare-NAVApplicationObject cmdlet to create these delta files.

       Copy Code
      Compare-NAVApplicationObject -OriginalPath ORIGINAL -ModifiedPath MODIFIED -DeltaPath DELTA
      Note
      Your delta files must be one-to-one with the objects you have added or modified. You cannot include a single merged delta file. If you output your export file as a single file use the Split-NAVAppplicationObjectFile cmdlet to create the individual files.

  5. Package your new NAV App.

    For more information, see How to: Create an Extension Package.

Extending Other NAV Apps

You can extend a NAV App from another NAV App. When you do that, you create a dependency between the original NAV App and the one extending it. This dependency must be verified and compiled when the NAVApp is published.

You must have the source code for the NAV App that you want to extend available in the Dynamics NAV development environment to use as the base of your app. To create a dependent app - or one that extends another NAV App then becomes the following:

Note
If you do not identify a dependency when you build your NAV App package, at publish time you will receive errors related to the base objects missing and the publish operation will fail.

Insert section body here.

To create a dependent or extending NAV App

  1. Import and compile the source code for the NAV App that you want to extend.

  2. Use the Export-NAVApplicationObject cmdlet to establish the new base for your app deltas.

  3. Extend the NAV App with your modifications and additions using the development environment.

  4. Use the Export-NAVApplicationObject and the Compare-NAVApplicationObject cmdlets to export and create the deltas for your app. Since you are comparing against a base that has the NAV App your extending in it you should only see deltas for your changes.

  5. Package your NAV App with the New-NAVAppManifest, Get-NAVAppInfo and New-NAVAppPackage cmdlets making sure to use the -Dependencies parameter on the New-NAVAppManifest to identify the NAV Apps that you dependent on.

See Also