Introducing Extensions in Microsoft Dynamics NAV 2016

We are very excited to announce the arrival of new development capability in Microsoft Dynamics NAV 2016, called Extensions.

Extensions enable you to modify your Microsoft Dynamics NAV system without directly altering the source resources, making it easier to deploy, manage, and upgrade customizations or extensions. While you will still use the existing Microsoft Dynamics NAV Development system to customize or extend Microsoft Dynamics NAV, a new set of Windows PowerShell cmdlets have been introduced that mean you can add your changes into a proprietary package format, called a .navx package file. These packages can be installed, and more importantly uninstalled, from a Microsoft Dynamics NAV system with ease. Packages can be automatically upgraded through the installation process, so up taking newer versions is made easier.

NAVBlog_Ext1

You might be wondering by now how an extension can be used to customize a system without modifying the source code? Extensions are, in the simplest terms, the runtime application of objects and object deltas for a specific combination of extension and tenant. When an extension is published to a Microsoft Dynamics NAV deployment, it compiles the objects in it against the current application database, and then an app installation for a tenant stores the association and builds the needed data schema. At runtime, it simply loads the associated objects for that app and tenant.

By doing this, we remove the need to merge code but we also introduce some limitations, specifically on what properties you can modify on objects such as pages and tables, and there are complete restrictions on altering existing codeunits. To affect the logic in extensions, you need to use the new eventing model that is also being introduced in Microsoft Dynamics NAV 2016. It’s important to note that there are no restrictions on the introduction of new objects or codeunits.

To create and deploy an extension:

NAVBlog_Ext2

If you need to update an extension, you simply uninstall the old version and then install the updated one. As a developer, you will need to code specially named upgrade functions in one of your codeunits in your extensions. These functions are automatically called when the extension is installed and can access the data that was automatically archived by the system when the previous version was uninstalled.

We plan to continue to enhance the extensions story in future versions of Microsoft Dynamics NAV, so stay tuned!