To make your extension available to users, the package must be published to a specific Microsoft Dynamics NAV Server instance. The extension can be installed for one or more tenants.
To publish or remove an extension
In the Microsoft Dynamics NAV 2016 Administration Shell, use the
Publish-NAVAppcmdlet. The cmdlet takes as parameters the server you want to install to and the .navx package file that contains the extension. The following example publishes the extension MyExtension to the YourDynamicsNAVServer instance.
Copy CodePublish-NAVApp -ServerInstance YourDynamicsNAVServer -Path MyExtension.navx
Publish does more than just update internal tables. It also compiles the components of the extension behind-the-scenes and builds the necessary metadata objects that are used at runtime.
You can get an overview of the published extensions and their state using the
Get-NAVAppInfocmdlet. If no tenants have a specific extension installed, you can completely remove it using theUnpublish-NAVAppcmdlet.In the Microsoft Dynamics NAV 2016 Administration Shell, use the
Unpublish-NAVAppcmdlet. The cmdlet takes as parameters the server you want to remove the extension from, and the name of the extension. The following example removes the extension MyExtension from the YourDynamicsNAVServer instance.
Copy CodeUnpublish-NAVApp -ServerInstance YourDynamicsNAVServer -Path MyExtension
Once an app has been published, it must be made available for any tenant that wishes to use it.
To install an extension
In the , use the
Install-NAVAppcmdlet. The following example installs the MyExtension for Tenant1 and Tenant3. In single-tenant deployments, you either specify default as the tenant ID, or you omit the -Tenant parameter.
Copy CodeInstall-NAVApp -ServerInstance YourDynamicsNAVServer -Name ”My Extension” -Tenant Tenant1, Tenant3
Use
Get-NAVAppInfo -Tenantcommand to get an overview of the extensions for that tenant, use theGet-NAVAppTenantcmdlet to get all tenants that have installed a specified extension, and uninstall an extension using theUninstall-NAVAppcmdlet.
Note When you uninstall an extension that includes tables and fields, this impacts the database schema and any data that the tables and fields contain. For more information, see Extending Microsoft Dynamics NAV Using Extension Packages.




