#GPPT Free Automatic Lookup Example


David Meego - Click for blog homepageWith the completion of development and release of Build 28 of GP Power Tools, now is the time to publish more examples for the Developer Tools module. Please see the GP Power Tools Samples page for additional examples that you can download and use for free.

This example is simple and can speed up data entry in Microsoft Dynamics GP. It does require GP Power Tools (GPPT) installed and the Developer Tools module registered. If you don’t have GP Power Tools installed or the Developer Tools module registered, feel free to install and start a free 30 day trial period, so you can test out this and the many other samples.

This sample will automatically open the Customer ID, Vendor ID and Item Number Lookups when tabbing off the required field without entering a value. It works well with the SQL Search across Multiple Fields Lookup Example posted recently which only takes effect when a value has been entered. To keep using it, you will need to have GP Power Tools – Developer Tools module registered and installed on every workstation.

Auto Lookup

The idea behind this customisation is to ensure that the required field is entered and if a user tabs off the field when empty, the system will prompt for the field to be entered by automatically opening the associated lookup window.

Note: You can still use Ctrl-L or the Lookup button to use the standard lookup before tabbing or if you have enter a seed value into the field.

Trigger Registration and Scripts

A trigger has been added to execute before the original pre script on the field following the Customer Number, Vendor ID, or Item Number fields in the tab sequence. There is one trigger for each field on each window where you want the Auto Lookups to work.

There are multiple Triggers named LOOK_A_CUST_XY, LOOK_A_VEND_XY and LOOK_A_ITEM_XY, where XY is a unique descriptor. The X number used to specify the type of window (Cards, Inquiry, Transaction module) and the Y number is just a sequence number to differentiate between the triggers.

These triggers can be duplicated and the scripts adjusted to add the Auto Lookup functionality to any other window in any product. The code needed is only a few lines that can be pasted into the default script after the if isopen() then statement. You will need to adjust the ‘Vendor ID’ to ‘Customer Number’ or ‘Item Number’ as appropriate and also change the ‘Lookup Button 1’ to match the button used on the window.

	if empty('Vendor ID') then
		focus 'Vendor ID';
		run script 'Lookup Button 1';
		OUT_Condition = true;
	end if;

Supplied with the example are triggers to add the functionality to

  • Customers: 13 Windows in core Dynamics.dic
  • Vendors: 16 Windows in core Dynamics.dic
  • Items: 18 Windows in core Dynamics.dic

You can add as many additional triggers as you desire to add the functionality to additional windows in core Dynamics.dic or to any window in a 3rd party (Microsoft or ISV) dictionary.

Installation

All the resources for the SQL Search Lookup functionality are contained in the LOOKUP_AUTO project which can be opened from the Project Setup window once the project is installed. If you make changes or add triggers for new windows, you can export and import using this window once the project exists in your system.

Installing the sample code for the first time uses the Configuration Export/Import window as the Project does not exist in your system yet. Just download the configuration settings file from the link at the bottom of this article. Extract the contents of the zipped archive, open Configuration Export/Import and select the configuration settings file. Click Import and click OK on the Import Settings File window when it is displayed.

Please share this information and provide feedback as every Microsoft Dynamics GP site should have this functionality.

Enjoy

David

Download here: GP Power Tools Settings Lookup_auto.dbg.zip

This article was originally posted on http://www.winthropdc.com/blog.

One thought on “#GPPT Free Automatic Lookup Example

Please post feedback or comments

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.