Microsoft Dynamics GP Developing for Dynamics GP
A blog dedicated to the Microsoft Dynamics GP Developer & Consultant community
 
Welcome to MSDN Blogs Sign in | Join | Help

Developing for Dynamics GP

by David Musgrave (Australia) and the Microsoft Dynamics GP Developer Support Team (USA)

News

  • Please use the Blog Feedback? - Contact Us link at the top of the page to email questions relating to the blog itself.

    If you wish to ask a technical question, please use the links below to ask on the Newsgroups. If you ask on the Newsgroups, others in the community can respond and the answers are available for everyone in the future.

    Please do not use comments on pages and posts to ask questions unrelated to the topic on that page or post.



    Dates of Interest:

    11-Jul-2008: Blog Created by David Musgrave.
    10-Oct-2008: First Post by Scott Stephenson.
    04-Nov-2008: First Post by Dave Dusek.
    11-Nov-2008: First Post by Beth Gardner.
    28-Nov-2008: First Post by Chris Roehrich.
    30-Dec-2008: First Post by Patrick Roth.
    24-Feb-2009: First Post by Greg Willson.
    22-Apr-2009: First Post by David Clauson.
    04-May-2009: First Post by Ryan Wigestrand.
    19-Jun-2009: First Post by Dawn Langlie.
    03-Jul-2009: First Post by Emily Halvorson.
    23-Sep-2009: Created Twitter account with blog feed.
    20-Nov-2009: First Post by Alice Newsam.



    WorldMaps Statistics since
    24-Feb-2009:




    Click for WorldMaps Stumbler



    Translator Tool:




    Social Networking

    Follow David Musgrave and the blog on:

    David Musgrave on Twitter

    David Musgrave on LinkedIn


    Disclaimer

    This blog is provided "AS IS" with no warranties, and confers no rights.

    The links in this blog may lead to third-party Web sites. Microsoft provides third-party resources to help you find customer service and/or technical support resources. Information at these sites may change without notice. Microsoft is not responsible for the content at any third-party Web sites and does not guarantee the accuracy of third-party information.

Contents

Favourite Posts

Blog Links

Newsgroups Links

Resources Links

Hybrid - Setting a push button to Hyperspace

Patrick Roth - Click for blog homepageTrivia question for today:

Given the following sequence of events:

In Microsoft Dynamics GP, in a control field such as Customer Number, the user types in "AARON". The user then presses the associated lookup button.

What happens?

A. Focus moves to the button causing the field change script to run and validates that Customer Number "AARON" exists.
B. Focus remains on the Customer Number field and the lookup window opens.
C. Both.

Answer:

B. Focus remains on the Customer Number field and the lookup window opens.

Your experienced GP user will know that this is a 'feature' of Dynamics as the user can enter the first few characters to seed the lookup.  When the lookup opens, the window will start to fill from the entered characters making it easier to find the "AARONFIT0001" customer they were looking for.

Bonus points then to those who know why this works?  A hint is that this seems similar to the CausesValidation property in C# for fields.

If you aren't a Dexterity developer, you probably do not know that this is the Hyperspace property.  The reason is that the Modifier/VBA developers might not be as familiar with this property is because in Modifier we do not let you change this property.  While I can see perhaps that in general this property shouldn't be changed for existing Dynamics GP buttons, it seems to me that it should be customizeable for a button added by Modifier. 

Why would you need to change this property?  Strictly speaking; it isn't critical that it must be.  However if the developer would like to add their own custom field with validation and a lookup to that field, then you need this.  Otherwise when you click the lookup button - focus leaves the custom field causing the change script to run.  Because potentially only a few characters were entered; validation would fail potentially giving an error message when the user just wanted to use a lookup.

The solution to this is to use a bit of pass through Dexterity via Continuum to change this property.

Dexterity has a function called Field_SetBooleanProperty() which can be used to set quite number of properties.  While every property cannot be set with this function, we're OK because we can set the Hyperspace property with it.

In this example, I'm assuming the user modified the Customer Maintenance main window to add a new local field called "MyButton" to be the new "lookup" button that the Hyperspace property needs to be set.

A good spot for this type of code would be before or after the window opens.  The code sample below shows how I would code this type of customization using Modifier to add the local button named "MyButton" and the VBA code to change the Hyperspace value to "True".

Code Example
 
Note: This customization uses a method of executing Dexterity sanScript code from VBA which is unsupported by Microsoft.
 
Regards,
 
Patrick
Dynamics GP Developer Support 
Posted: Friday, October 30, 2009 8:00 AM by Patrick Roth [MSFT]

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker