Dynamics NAV Extensions
“You can extend and customize a Microsoft Dynamics NAV development without modifying the original application objects. With extension packages, you install, upgrade, and uninstall functions in on-premises deployments or for select tenants in a multitenant deployment. Customers can easily add or remove horizontal or customized functions to their solutions that upgrade much easier than past solutions.”
Also, Extensions are the only way to extend Dynamics 365. So, what are Extensions?
Extensions are packages that contain additional functions, report layouts (at least starting in NAV 2017), permissions, and more. They can also be easily installed, uninstalled and upgraded.
You cannot make changes in standard code when developing an extension. You can modify standard objects and add fields or keys to tables and you can add fields or actions to pages. But, you cannot add any code to the triggers of the new fields, to any existing triggers, to existing or new actions, and you cannot modify reports.
This sounds like a big limitation. Yes, it is. However, you can still develop a lot of functionality as an extension. You will have to use events, the new “hype” in Dynamics NAV. Events were introduced in NAV 2016, but there were not a lot available.
An event is like an integration point into NAV. You can use it without seeing any of the other codes in the product. It gives developers a prebuilt way to add customizations to NAV without touching any of the codes from Microsoft. These events are sprinkled throughout the system in the really important parts like changing the value of a field, inserting a record, releasing a sales order, posting a purchase order, checking a credit limit, etc.
For example, if you added a custom field to a sales order and required it to be filled in before posting the order, you could subscribe to the “On Before Post Sales Document” event and write your code separate from the base objects.
If developers have to modify the NAV base code, they should use the hook pattern which will make upgrades easier. The new best practice is to modify the base code only as a last resort. Since all Events or hooks have not yet been developed by Microsoft, if an Event is needed but not available, developers should report this to Microsoft with the code requirement so that it may be included in future releases and/or cumulative updates.
With NAV 2017, you now have events available in a lot of places so that, if you design the code properly, you can nearly develop anything you want as an extension. Once the extension package is created, it is also not that easy to see the code of the extension anymore, which means that your code is protected. You can see the source code of an extension through the debugger, but you cannot access the code through the development environment and you cannot modify an extension, unless you have the source code. Also, extensions can be installed without having to change standard objects as they upgrade themselves. Therefore, upgrades will be a lot easier in the future when extensions are used.
Extensions are meant mainly for ISVs, who want to create functionality for Dynamics 365 and want to be able to sell that functionality to Dynamics 365 users. And since Dynamics 365 is based on Dynamics NAV, ISVs can also deliver their add-ons as extensions to Dynamics NAV partners and customers.