What’s New in Visual Studio Tools 2010

Patrick Roth - Click for blog homepageToday, I want to share with you what I think are the 3 coolest new features in Visual Studio Tools for Microsoft Dynamics GP 2010 (VSTools).

Modal Dialog Notifications

In this version, VSTools joins VBA with the capability for modal dialog notifications.  The VSTools implementation of this functionality is the same.

By getting a “BeforeModalDialog” notification, the VSTools developer has the opportunity to change the message displayed to the end user or even answer the dialog for the end user so the dialog is not displayed.

By getting an “AfterModalDialog” notification, the VSTools developer can get the response the user selected to the modal dialog and take action based upon that response.

Modal Dialog notifications are per window.  For each window, any type of modal dialog generated by ask() or warning statements will trigger the handling script.

Modal Dialog Handler

public void Initialize()
     Dynamics.Forms.PmVendorMaintenance.PmVendorMaintenance.AfterModalDialog +=
       new EventHandler<AfterModalDialogEventArgs>(PmVendorMaintenance_AfterModalDialog);

void PmVendorMaintenance_AfterModalDialog(object sender, AfterModalDialogEventArgs e)
     if (e.Message == “Do you want to save changes?”)
       MessageBox.Show(“The user selected ” + e.Response.ToString());             

Table Buffers as Parameters

With this version, the dag.exe will now generate procedures & functions for scripts that have table buffers.  The developer will be able to call these procedures and get or set values in the tables passed from and back from the script.

VSTools still has the restriction in that procedures/functions are not generated for procedures with reference or anonymous parameters.

Function and Procedure Notifications

I think one of the best and the biggest features added in VSTools is the ability to have function and procedure notifications. This is essentially the same functionality that Dexterity enjoys.

Script Notification Sample

public void Initialize()
   Dynamics.Procedures.AddSuccessfulLoginRecord.InvokeAfterOriginal += 
      new AddSuccessfulLoginRecordProcedure.InvokeEventHandler(AddSuccessfulLoginRecord_InvokeAfterOriginal);

void AddSuccessfulLoginRecord_InvokeAfterOriginal(object sender,
    AddSuccessfulLoginRecordProcedure.InvokeEventArgs e)
    MessageBox.Show(“User ” + Dynamics.Globals.UserId.Value + ” was logged in successfully.”);

With these changes, VSTools 2010 gains signifigant capabilities developers will find valuable.

Best regards,

// Copyright © Microsoft Corporation.  All Rights Reserved.
// This code released under the terms of the
// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)

Comments (8)

  1. Ric says:

    How about handling scrolling windows? 🙂

  2. Patrick Roth [MSFT] says:


    That depends what you mean by "handling"?  I’m guessing you mean "handling" as in "programatically walk through/select a specific line".  If so, then the answer is "no" – nothing new in this area.

  3. Ric says:

    Hi Patrick. Yes your assumption is correct.

    I just used eConnect for that purpose for forms with scrolling windows but don’t have any item detail windows.

    Anyway, just want to commend you on your post. It’s really helpful. Thanks! 🙂

  4. PA- Jasmine says:

    Hi Patrick,

    I understand this is available now in version 2010. How do i handle this in lower versions of VS toolkit?


  5. David Musgrave says:

    Hi Jasmine

    Short answer: You can't.  

    Long answer: You could use some VBA and store the answer in the DUOS and then use VSTools to access the SY_User_Object_Store to read the value.