Visual Studio 2010 Templates for Add-ins in Microsoft Dynamics NAV 2009 RoleTailored client

When Dynamics NAV 2009 SP1 had been released with the possibility to host your own client controls in the metadata driven UI of the RoleTailored client, I heard the need from partner for tools that help with the firsts steps to create such an Add-in. I had released a number of templates for Visual Studio at that time.

Now I felt that it is time for an update. An Visual Studio Extension that can be managed with the the easy to use Extension Manager within Visual Studio.

GoldenCaller
You can download the Visual Studio templates for VS 2010 here. (Dynamics NAV 2009)
The last version templates for previous version of Visual Studio are still available here. (Dynamics NAV 2009)

 

After the installation Visual Studio will offer you a few new Project and Item templates. The creation of a new Add-in is very easy. First select the project type based on the .NET client framework your Add-in control is built upon: WinForms or WPF.

image

Be sure to leave the Target Framework to highest 3.5. The .NET framework version 4.0 is not yet supported by the Dynamics NAV versions that we have shipped so far. (But it certainly will be in next release.)

image

Next step is to create an Add-in class, the factory for the .NET control you whish to host in the RTC. A view templates are provided, for the typical communication types. For example single value binding through the source expression of the field, string document binding, binary data binding, getting information from the Add-in context, etc.

Select to add a new item to your project and pick one of the Add-in templates from the Dynamics NAV category. You will find a short description for each Add-in template on the right side.

image

Next the Wizard will ask you to enter some basic information and then create the class for you in the VS project.

image

Please note the Help icon – it opens the API help for Add-ins in the RoleTailored client from MSDN. In the next step you will customize the Add-in class code which the wizard has created for you. This is pretty straight forward.

  • Update the reference to the Microsoft.Dynamics.Framework.UI.Extensibility.dll library to your RoleTailored client installation
  • Implement the CreateControl method to return an instance of the .NET control you want to host.
  • For data binding and trigger support there are a few further methods which you can customize
  • After registration in the Add-ins table you are ready to use your new Add-in for fields on your pages in NAV.

 

If you ever want to remove the templates, simply open the Extension manager I Visual Studio 2010 and identify the Template package and press “Uninstall”.

 

You can download the updated Visual Studio template here.

 Christian Abeln
Senior Program Manager
Microsoft Dynamics NAV