Hi welcome to this how do i video in the extension series for Microsoft Dynamics NAV in which we will show you how to work with prerequisites and dependencies in extensions this video is based on the extension that was created in the earlier video how do I build a basic microsoft dynamics nav extension at the end of this video we’ll have added a prerequisite being the item table to the existing extension created in the previous video how do.
I build a basic Microsoft dynamics nav extension on top of that we will have created a complete new extension that is depending on the existing one will do this in 5 easy steps first I’ll explain the exact difference between prerequisites and dependencies as these are sometimes confused next we’ll add a prerequisite to the already created item classification extension afterwards we will create a completely new development environment because we needed to create and test a new dependent extension let’s get started what is the difference between these two well basically prerequisites define the objects that must be in the database before an extension can be installed and dependencies define the extensions that must be installed before a particular other dependent extension can be installed both are defined in the manifest so let’s focus on the prerequisites and change the extension that we have created in the video how do I build a basic Microsoft dynamics nav extension by adding a prerequisite to the item table as.
I said we do this in the manifest now we already have a manifest and we obviously don’t want to change the app ID so we will check if the manifest already existed and will preserve the app ID if it did while creating the manifest you see that we added one parameter prerequisites to describe the prerequisites of this extension when you create the nav X file that includes this manifest you will not be able to import this extension in a database without the marked objects when talking about dependencies we always talk about two or more extensions so to show you a dependent extension we need to create an additional one which means we need to create a new development environment for this new extension creating a development environment for an extension has been explained in the video how do.
I build my own development environment for starting to develop Microsoft dynamics nav extensions so let’s cut short and execute the scripts from that video for my new extension obviously we are creating an extension that is dependent on the already created item classification extension that means we need to create a development environment of a database that has these objects already in it basically our original and dev environment need to contain the develop database of the item classification extension so let’s create a backup of the item classification dev database to create a backup.
I will use the following T SQL script which I will execute in the sequel server management studio the extension that.
I will create will be called item classification 60d we change the script and the naming accordingly we didn’t include the test environment because we can use the same test environment that we have already created in the previous video so at this point we have our new development environment let’s develop our new extension I’ll do this by simply important code unit 68000 which has a subscriber function to one of the events that was raised in the dependent extension item classification base luckily it’s going to extend the item classification calculation method with new business logic for this video we will not go further into the business logic so now that development of the new extension is ready let’s create an Avex file and test it in the test environment.
I will use the same script and method that was already explained in the video how do.
I build a basic Microsoft dynamics nav extension so let’s just execute this script notice that in the script when creating the manifest we reference the nav X file from which this extension is dependent when you open the manifest you will see that the dependency is described to test this we simply use the same test environment that we have already created in the previous video let’s first remove all extensions that still might be in the test environment now.
That we have no extensions in the test environment let’s see. If we can publish the dependent extension without the item classification extension it depends on obviously we cannot we get this error that’s obvious the item classification extension needs to be in the database to be able to create all the metadata for the second extension so let’s publish both extensions in the right order as you can see now that worked when we try to only install the item classification 60d extension it will ask you to also install the dependencies so you’re not able to make a mistake.
All dependent extensions will be always installed and here you go both extensions are installed because of this dependency in this video you have seen how to work with both prerequisites and dependencies if you want to learn more about extensions please visit this page on the dynamics learning portal thanks for watching and see you soon in another how do I video from the Microsoft Dynamics NAV extension series you.
http://worldtrafficmailer.com/promowall.php?rid=3622
FREE $1,900+ Worth of Paid Advertising Daily
Discover more from The most effective and simplest marketing techniques!
Subscribe to get the latest posts sent to your email.








