Adding a lookup control

To add a lookup control to a window in your application, complete the following steps:

  1. Add the lookup button.

Add the global field named ‘Lookup Buttons’ to the window and place it directly to the right of the lookup field.


Global field


Lookup Buttons

This field is an array of push buttons. When you add this field to the layout, Dexterity assigns it the next available array index.

  1. Attach a lookup button script.

Attach a change script to the lookup button similar to the following example. In this example, the Lead Lookup form will appear when the user clicks the lookup button. The return to clause of the open form statement retrieves the value passed by the lookup form using the return statement.

open form IG_Lead_Lookup return to 'Lead ID';

{Set the invisible key fields in the lookup window.}
'Lead ID' of window 'Lead Lookup' of form IG_Lead_Lookup = 'Lead ID';
'Lead Name' of window 'Lead Lookup' of form IG_Lead_Lookup = 'Lead Name';
'Salesperson ID' of window 'Lead Lookup' of form IG_Lead_Lookup = 'Salesperson ID';
run script 'Redisplay Button' of window 'Lead Lookup' of form IG_Lead_Lookup;

The script sets invisible key fields on the lookup form, then runs the script for the Redisplay button. This script uses the fill window statement with the from current keyword to place the scrolling window focus on a record currently displayed in the Lead Maintenance form.

In your development dictionary, you can also open an existing Microsoft Dynamics GP lookup form, returning any valid return values to the lookup field. See Using existing lookups for more information.

  1. Add an accelerator key.

To enable the accelerator key for the lookup button (CTRL+L) choose Link Lookup from the Tools menu. Click the lookup button, drag the pointer to the lookup field, and release the mouse button. A highlight will flash to indicate that the link succeeded.

Documentation Feedback