Today, 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 NotificationsI 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,Patrick
// 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.)
Posting from the Dynamics GP Blogster
http://dynamicsgpblogster.blogspot.com/2010/02/vst-modal-dialogs-handling-make-their.html
Posting from DynamicAccounting.net
http://msdynamicsgp.blogspot.com/2010/02/what-new-in-vst-2010.html
Posting from Mohammad Daoud
http://mohdaoud.blogspot.com/2010/02/dynamics-gp-vs-tools-2010.html
How about handling scrolling windows? :)
Ric,
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.
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! :)
Hi Patrick,
I understand this is available now in version 2010. How do i handle this in lower versions of VS toolkit?
Thanks.
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.
David
PLEASE READ BEFORE POSTING
Please only post comments relating to the topic of this page.
If you wish to ask a technical question, please use the links in the links section (scroll down, on right hand side) to ask on the Newsgroups or Forums. If you ask on the Newsgroups or Forums, others in the community can respond and the answers are available for everyone in the future.