With GP 2013 web client around the corner, there is lot of buzz around what’s going to be supported with web client and what’s not.
One of the things that not going to be supported in web client is VBA customizations. Therefore, its a good time to start upgrading your VBA customizations.
In vba, code is saved in *.vba files in GP folder. For each dictionary file there is a corresponding vba file. You have to write your code in those existing files. You can’t divide these code files based on projects.
In VS Tools you can create projects for logically related customizations. This will help you in maintaining code in longer run and also isolating the issues related to different customizations. Therefore, if you are upgrading your vba customizations from vba to VS Tools, it’s a good time plan them carefully.
VS Tools supports both C# and VB.net languages. You can select languages based on your personal preference and past experience. However, both languages are powerful developer tools and first-class programming languages that share the common language runtime in the .NET Framework. Here are some article which outlined difference between two languages
If you have lot of code which you want to convert as it to VS tools you can consider using VB.net because in terms of syntax VB.net is closer to vba and you will need fewer changes in the code.
If your vba include cross dictionary references, you will need to add reference to assemblies for other dictionaries in your VS Tools solution. You can add reference using Project>> Add Reference menu option, browse to the dll you want to use. You can find dlls for core products in VS Tools installation folder.
C:\Program Files\Microsoft Dynamics\GP2010 VS Tools SDK\
C:\ Program Files (x86)\Microsoft Dynamics\GP2010 VS Tools SDK\
Unlike vba, you don’t need to worry about circular reference in VS Tools environment.
If your customization is based on modified forms or third party products. You can use Dictionary Assembly Generator (DAG.exe) to create managed code assembly that provides access to resources in an dictionary.
The DAG.exe is installed in the location where you installed Visual Studio Tools SDK. Typically this will be the following location:
C:\Program Files\Microsoft Dynamics\GP2010 VS Tools SDK
C:\ Program Files (x86)\Microsoft Dynamics\GP2010 VS Tools SDK
Here is an examples of using DAG to generate dll for modified forms dictionary:
DAG is command line utility, you can find Graphical User Interface (GUI) in following blog post:
Each dictionary has global variables related to it. Globals for an application dictionary are accessed through the dictionary class. This class has a Globals property that provides access to the collection of globals in the dictionary.
For example, to access the collection of globals in the Dynamics dictionary, use the following syntax:
To access a specific global value, such as the current user’s ID (UserId), use the following syntax:
Debugging code in vba was very simple, you just add a break and perform action to hit the break point. However, in VS Tools the process you need to carry out the for debugging the code is:
Debugger in Visual Studio is very powerful tool. Refer to following article for using debugging in visual studio:
Dynamic User Object Store (DUOS) is usually used for storing data from additional fields added using modifier. In VS Tools you can use table SyUserObjectStoreTable to save and access DUOS data
If you are using ADO in your vba customization, you can use the GPConnNet.dll so that you don’t have to hard code a connection string. You can find this file in folder
C:\Program Files\Common Files\Microsoft Shared\Dexterity\v2.0
However, you will need to get keys from Microsoft support to use it. Refer to following article for details about how to use it to connect database
If you are using San Script in your vba code, consider using continuum. Continuum is the COM programming interface available for Microsoft Dynamics GP which has ability to run sanScript code in the Microsoft Dynamics GP application.
You can download documentation from Microsoft Dynamics GP 2010 Tools Documentation: Continuum Application Programmer’s Interface (API)
Here is an example of using Continuum
Note: The use of the Continuum Integration Library to execute Dexterity scripts from VBA is not supported.
You can additional menu option in Dynamics GP Forms through VS Tools. Here is an example to add menu option DynamicsGPAddin1 in Customer maintenance form
You can use “Menus for Visual Studio Tools” for Microsoft Dynamics GP 2010 to an menu option. You can download the dll for from partner source or customer source. Example you can a new menu option under Cards>> Sales using it.
Menus for Visual Studio Tools for Microsoft Dynamics GP 2010 (CustomerSource)
Menus for Visual Studio Tools for Microsoft Dynamics GP 2010 (PartnerSource)
VS Tools has option for Function and Procedure Notifications, you get before and after Notifications for the procedure and function call. It can be very handy to execute code globally based on procedure execution. Refer to following post for example:
If you have some existing vba code with report writer reports, you can consider using dexterity for such customizations.. VS tools does not have event handler for the report writer events.
You can design forms in VS tools and use them in customizations to replace the forms designed in VBA. However, they are not going to be supported in web client. Only forms designed in dexterity or modified using modifier will be available in web client. If your vba customization has custom forms you should consider using Dexterity to upgrade this customization for web client instead of VS Tools
Other resources to help you get started with VS tools are:
Getting started with VS Tools:
Adding config file in VS Tools customization