25 Sep’17

D365 Business CentralSteps to create and use a Client Control Add-in in Microsoft Dynamics NAV

Introduction:

Microsoft Dynamics NAV control add-ins can be created using the NAV .dll assembly viz. Microsoft.Dynamics.Framework.UI.Extensibility.dll assembly. This .dll binds the NAV control add-in and the NAV environment. This control add-in has to be implemented in Visual Studio and then registered in Dynamics NAV by navigating to Control Add-ins.

Pre-Requisite:

Microsoft Dynamics NAV

Purpose:

In this article, I will be demonstrating the steps to create and use a Client control add-in in Microsoft Dynamics NAV.

Procedure:

  1. Open Visual Studio. Create a new C# class library project and add a reference to the Dynamics.Framework.UI.Extensibility.dllassembly. This assembly is present in the following directory: C:\Program Files (x86)\Microsoft Dynamics NAV\100\RoleTailored Client.
  2. In the Visual Studio project namespace, create a new interface and add code for the control add in. The code is mentioned below:

    [ControlAddInExport(“NAVaddin”)]

    The name ‘NAVaddin’ will be used while registering the control add-in in Dynamics NAV.

  3. Now you need to sign the assembly. Navigate to properties->Signing->select Sign the assembly. In the Choose a strong name key file drop down list, select ‘New’. In the Key File name enter an appropriate name and clear the ‘Protect my key file with a password’ check box.
  4. The next step is to generate a unique public key in Visual Studio for the project as this public key is required while registering the control add-in in Dynamics NAV.
  5. Navigate to Tools->External Tools.

    Parameters to be filled are as below:

    Title: Get &PublicKey

    Command: C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\sn.exe

    Arguments: Get &PublicKey

    Now, ‘Get PublicKey’ will appear as an option under Tools which on clicking will generate the public key for the project.

    After clicking ‘Get PublicKey’->the public key is generated and displayed as below:

  6. Save and Build the solution. After successful build of the project, the .dll file will be generated.  
  7. Creating the Resource .Zip File.

    You must create a single .zip file containing manifest and any of the resource files used in Visual Studio. This .zip file has to be used while registering the .dll in Dynamics NAV.

  8. The next step will be to copy the .dll file to two locations in Dynamics NAV as given below:
    • C:\Program Files\Microsoft Dynamics NAV\100\Service\Add-ins
    • C:\Program Files (x86)\Microsoft Dynamics NAV\100\RoleTailored Client\Add-ins
  9. Go to NAV administration and restart NAV services so that the changes are reflected.
  10. Navigate to ‘Control Add-ins’ in NAV windows client and create a new Control add-in. Add the same control add-in name which is mentioned is step 2:

    Click on ‘Import’ action to import the .zip file containing all the Visual studio resources as created in step 7.

    After performing these steps, the client control add-in will be registered in Dynamics NAV and the triggers defined in Visual Studio, if any will be visible in the NAV Development environment if the Control add-in is selected in the properties of the control.

Conclusion:

Using this procedure, you can create complex functionalities in Visual Studio and use the .dll control add-in file in Dynamics NAV. I have created SMS functionality from NAV and Digital Signature functionality in NAV using the above procedure of adding a client control add-in.
 

Written by

Team Member

CloudFronts

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Reading more then 10K records in D3FOE OData API

    11 July’ 2018

    Introduction: We all know Dynamics 365 Finance and Operations has limitation of 10K records to be fetched at a time usi...

    Read more
  • Paging in D365 Customer Engagement v9.0

    10 July’ 2018

    Introduction: The Xrm.retrieveMultipleRecords method is used to retrieve a collection of records in Dynamics 365 Custom...

    Read more
  • Set up Dynamics 365 connection in Microsoft Social Engagement

    10 July’ 2018

    Introduction: This blog explains how to Set up Dynamics 365 connection in Microsoft Social Engagement. Steps to be follo...

    Read more
  • Voice of the Customer failed to install

    10 July’ 2018

    Introduction: Many people face issues in installing Voice of Customer solution on v9 environment and trying repeatedly ...

    Read more
  • Scribe Insight AX as a Web Service Find Block issue

    10 July’ 2018

    Introduction: If we need to look up for any value from AX then we do it by using a Find Block in Scribe Insight Eg: Basi...

    Read more