Tag Archives: Modifier

Modifier w/VBA – an example

I’ve had people ask me why they would ever need the Modifier tool, and what use is VBA in enhancing Dynamics GP? Well, it has come in quite handy over the years.  This is one example of a customer request where Modifier and VBA were the perfect tools for the job.

The Modifier is a tool that allows users to make simple visual changes to Dynamics windows, for example moving fields around or removing unused fields from the user space.  VBA can be used in combination with the Modifier to add to existing Dynamics logic or sometimes stop the logic from occurring, for example when someone clicks a button on the window.

Disclaimer: this article assumes a degree of experience with the tools, or at least an adventurous spirit… so if you’re the type of person who can take an example and run with it, this is for you!

Following is the request I received from my ideal customer (You gotta love a customer who provides screenshots and mock-ups of their desired outcome!):




As I said, a perfect scenario for a Modifier/VBA solution, so here’s how I addressed it step by step.  This particular customer has a systems analyst who administers their Dynamics GP environment, so these are the instructions I gave him.

1.  Open the IV_Item_Inquiry window in modifier

2.  Add a button for internet info. I named this PB_World, but it can be called anything. Just change the vba references below to your field names.

3.  Doubleclick the Field field in order to open the definition window and click the elipse (…) to set the graphic to the appropriate one (see below)



4.  Add another button for the backordered link


5.  This one will be set to invisible, but leave it displayed until the testing is completed

6.  The Backordered text field can be changed to be blue and underlined using the properties box. This will make it consistent with the other hyperlink fields on the window.

7.  Once those are done, open the modified window in GP and add it to VBA (if it’s already in the VBA project, you only need to add the two new fields that you created) – this example is in version 10, but the window should look the same.


8.  Once you’ve added those two fields from the item inquiry window, you’ll need to add the internet information window to VBA too, along with the appropriate fields:


9.  Open the sales item inquiry window and add the appropriate fields from there:


10. Finally, insert this code in the VBA project:

Private Sub PBWorld_AfterUserChanged()
InternetInformation.SelectInformationfor.Value = 4
InternetInformation.MasterID = ItemInquiry.ItemNumber
End Sub
Private Sub PushButtonM20_BeforeUserChanged(KeepFocus As Boolean, CancelLogic As Boolean)
SalesOrderProcessingItemIn.Include = 96
SalesOrderProcessingItemIn.Items = ItemInquiry.ItemNumber
SalesOrderProcessingItemIn.Redisplay.Value = 1
End Sub


In order to deploy to additional clients, simply copy the Dynamics.vba from that installation to the other workstations and you should be good to go.

Note: I had to experiment with the selection on the sales order processing item inquiry window to get to the 96 value. so it may be necessary to try various values to get the correct selection for your project.


Leave a comment

Filed under Microsoft Dynamics, Modifier, VBA