A Guide to Modifying Third-Party Forms in Microsoft Dynamics GP
When developing integrations for Dynamics GP, there are times when you need to modify a form installed with a third-party add-on. This blog provides step-by-step instructions on how to do so.
First, use the Alternate/Modified Forms and Reports form in the Setup section of Tools. Ensure that the third-party form is selected.
Open the desired form. In this example, I have selected Item Maintenance. Click on Tools > Customize > Modify Current Window.
This will open the Window customization application.
Click New on the toolbar window. Enter the information below and click OK.
In this example we’re modifying a toolbar button. Change the Appearance and the Back Color to match the image below.
From the toolbar, drag the okButton to the toolbar of the form window. Then click on File > Microsoft Dynamics GP.
Launch Visual Studio and create a new Microsoft Dynamics GP Add-in project.
In the GPAddIn.cs file, begin instantiation of the Item Maintenance form. See below for an example.
Next we will look for our okButton that we have just added. Because we created a local object it will by default be named LocalOkButton. You will notice that IntelliSense is unable to find our okButton. The reason for this is that Visual Studio, and by extension, our project, does not know about the changes we made to the third-party form. This is for two reasons; first, Visual Studio does not know about the third-party dictionary at all, and second, it also does not know about our modified form.
The first thing we need to do to inform Visual Studio about our modified form, is to find the Application ID number for the third-party form in our Dynamics GP installation. To do this, open the Dynamics.set file in your GP 2013 installation directory. In my case, it was located at C:Program Files (x86)Microsoft DynamicsGP2013Dynamics.set. Find the application of the modified form. In our case we will select Multi-Entity Management (5147).
Next we have to create both an application and forms dictionary assembly for the third-party add-on. To do this we will use dag.exe. DAG.exe will be located in the directory of the Visual Studio Tools for Dynamics GP installation directory. In my case the location was C:Program Files (x86)Microsoft DynamicsGP2013 VS Tools SDKdag.exe.
The first step is to create the application assembly. The syntax to do this is:
dag.exe /M
For example:
dag.exe 5147 “c:Program Files (x86)Microsoft DynamicsGP2013Dynamics.set” /M
When this process is completed you will find the assembly in the Visual Studio Tools for GP2013 SDK directory.
Now we must create an assembly of the modified forms. The syntax is nearly identical. You merely need to change the option flag at the end from /M to /F. The F indicated a Forms dictionary assembly.
The modified forms assembly will then be located in the Visual Studio Tools for GP2013 SDK directory.
Now return to the Visual Studio project and add references to the two newly created assemblies.
Now if you look for your button in the IntelliSense, you will find it as expected. From here you can add your desired functionality.
Please reach out if you have any questions or need additional information.
Written by:
Aaron Rumford, Business Intelligence Developer, FMT Consultants
Posted by: Jakob Bechgaard