Page 415
FIG. 16.4
The Department Update
form as it would appear
by using the
call_form subprogram
with no options specified.
FIG. 16.5
The When-button-
pressed trigger that
calls the Department
Update form. It con-
tains the no_hide
option.
FIG. 16.6
The Department Update
form as it would appear
by using the
call_form subprogram
with the no_hide
option specified.
Page 416
A directory is an application used to help the operator identify records. It is a tabular style form that produces a set of records based upon entered search criteria. At times the operator does not have complete information about the record to be selected. The directory allows the operator to enter some information and compile a visible list to records to choose from. For instance, suppose the operator wanted to identify the record for the employee with the last name "Kwasniewski." This is an extremely hard name to spell. The operator can enter the following expression in the last name search field: "K%ski". This will produce a short list of employee records that match the expression. The operator likely will be able to identify the record from the list.
Directories consist of three blocks. The first block is a nonbase table form style block that contains the search fields. The second block is a multi-record tabular style block that displays the results of the query. The operator does not have the ability to enter search values into this block. The third block is the button palette. In addition to the normal buttons, it generally contains buttons that call related forms. These forms are used to view additional information about the selected instance.
This design offers some distinct advantages over the straight tabular style form that uses the display fields as the search fields. The fields contained in the search block do not have to be visible in the display block. This means the directory can contain more search fields than the typical tabular form. The search fields are contained in a form pattern and are not limited to the width of the screen as in a tabular form. A second advantage of the directory is that the search criteria remains after the query is executed. In a normal form, after a query is performed, the search criteria are cleared. The operator must reenter the search expressions before a query can be performed. In our example of directory use, if the "K%ski" expression produced a large record set, the operator might be able to limit the set by entering a department number or adding additional characters to the expression. The operator would not have to re-enter the original search criteria since it was still contained in the search text item. This will increase operator efficiency.
The following are the basic steps needed to create a directory:
To create the search block, use the following steps:
Page 417
To create the display block, use the following steps:
go_block go (`two'); execute_query;
The preceding steps can be used to create a basic directory. The developer may add LOVs and form calling buttons as needed. The following section demonstrates the creation of an Employee directory.