Following on from my previous posts: Customising the Company Login window series Part 1 – Introduction, Customising the Company Login window series Part 2 – Visual Basic for Applications and Customising the Company Login window series Part 3 – Dexterity, here is a discussion about trying to create a solution using Visual Studio Tools.
As discussed in the earlier posts, the problem we are trying to overcome is that the company drop down list on the Company Login window is not wide enough to show a long company name. This can make it difficult to select the correct company when the company names are long and differ only by some characters at the end of the name.
Below is a screenshot of the original window from Microsoft Dynamics GP 2013.
Now I had planned to show you how to create the same customisation as the ones created previously using VBA and Dexterity. Sadly, that is not actually possible as Visual Studio Tools does not support the resizing of fields.
Visual Studio Tools for Microsoft Dynamics GP does not have the properties and methods required to natively read the size of a field and request it be changed.
So can you achieve the desired result using Visual Studio Tools?
The answer here is a conditional “Yes”.
It could be done “in theory” by using the unsupported method based on the Continuum Library and its ability to pass through Dexterity sanScript code for execution with the ExecuteSanscript() function. You can use similar Dexterity code to the code used in part 3 of this series.
Now on my machine I have Visual Studio 2013 installed and the Visual Studio Tools for Microsoft Dynamics GP 2013 only support Visual Studio 2010 and Visual Studio 2012. Thanks to my good friend, Mariano Gomez, we have the steps to install the Microsoft Dynamics GP Add-in Templates into Visual Studio 2013:
Now that I have the templates available, I was able to create the projects.
I spent some time trying to get the call to Continuum working, but sadly did not have much success. I was trying to use a technique based on Method 2 in this article by Mariano:
However, each time I added the interop.Dynamics.dll to my Visual Studio project, all the other references were broken.
So, at this stage I can’t provide you with the sample code or project files.
Let me put out the challenge to the developers out there…. Can you get the ExecuteSanscript() function from Continuum working so that you can call the Dexterity code to “modify” the window?
Post in the comments if you can make it work.