16 Understanding Search & Select Forms

16.1 Search & Select Forms

A search & select form is used to select a single predetermined field from a record in a predetermined file. Search & Select forms return only one value to the calling form, based on the dictionary alias. If no data dictionary (DD) alias matches the value, the first value from the data structure is returned.

16.2 Search & Select Events

These events can occur on the search & select form during runtime:

Dialog is Initialized

Post Dialog is Initialized

Grid Record is Fetched

Last Grid Record Has Been Read

Write Grid Line-Before

Write Grid Line-After

End Dialog

XAPI Subscribe Event

16.3 Search & Select Runtime Processing

This section discusses how runtime processes search & select forms. A search & select form should be attached as a visual assist only to data items that have the same data type as the form data structure element.

This section discusses form-level runtime processing only. Much of the runtime processing for the search & select "form" actually occurs on the level of the grid control, however.

16.3.1 Dialog Initialization

When a search & select form is called, runtime initializes these items in this order:

Thread handling

Error handling process

Business view columns (BC)

Form controls (FC)

Grid fields

Static text

Helps

Event rules (ER) structures

Next, it performs these actions in this order:

Create the tool bar.

Load form interconnection data into corresponding BC and filter fields, if any.

Fire Dialog is Initialized.

Fire Post Dialog is Initialized.

If the Automatically Find On Entry option is selected, begin detail data selection and sequencing in the grid control.

If runtime does not encounter errors, this step leads to the population of the grid control, ultimately.

16.3.2 Find Button

The Find button is a standard button on headerless detail forms that appears by default. When the user clicks it, runtime fires the Button Clicked event. If no errors exist in the filter fields, runtime performs data selection and sequencing for the grid control. After reloading the grid with the fetched data, runtime fires the Post Button Clicked event.

16.3.3 Select Button

The Select button is a standard button on search & select forms that appears by default. When the user clicks it, runtime fires the Button Clicked event. If no errors occur, runtime writes the values from the selected row to the BC and fires the Post Button Clicked event. Then it fires the End Dialog event and initiates the dialog close process.

16.3.4 Close Button

The Close button is a standard button on search & select forms that appears by default. When the user clicks it, runtime fires the Button Clicked and Post Button Clicked events in immediate succession. If no errors occur, runtime attempts to close all of the modeless child forms, if any exist. If any of these child forms cannot be closed, the Close button process is terminated. Otherwise, runtime fires the End Dialog event and initiates the dialog close process.

16.3.5 Dialog Close

Search & Select can be closed either by the user (typically by clicking the Select or Close buttons) or by the system. After performing any control-level close processing that might need to occur, runtime closes the form. If the event has not already occurred, runtime fires the End Dialog event. Then it performs these tasks in this order:

Load form interconnect data from BC for database commit.

Terminate error handling.

Terminate helps.

Free all form structures.

Destroy the window.

Scripting on this page enhances content navigation, but does not change the content in any way.