Trivia 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.
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.
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".
// 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.)
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.