Autofind Field Property
Obsolete
Refer to the Field_Options property in the DataDictionary class.
Purpose
To execute an automatic find eq (equals) on an entry_item command.
Syntax
set field_options field
file.field to dd_autofind
or
entry_item
file.field
{autofind
[... option]
}
File.field must have a Main Index in the definition of file.
What It Does
Autofind performs a find eq (equals) by the main index of file.field when an entry_item is executed on field. If a record is found whose value in the main index of file.field exactly matches the values in the item and any other items whose fields participate in the index, it is displayed on the screen. If no such record is found, the cursor exits the item normally and no record is moved into the buffer. No error will be declared.
set field_options field vendor.id_code to dd_autofind
When the cursor exits any item attached to Field id_code in File vendor after typing a value into it, DataFlex will search the main index for id_code in Database File vendor and display the record whose index value matches those in the screen buffer for the fields that make up the index. If there is no vendor record with a matching id_code index value, the cursor proceeds normally to the next item and no error is reported.
Notes
-
Autofind uses the Main Index for
file.fieldto search by. -
Do not use autofind with a
file.fieldwhose Main Index is non-unique, since the absence of the record number in the entry will prevent an exact match. Where you wish to find by a non-unique index, useautofind_ge. -
Where you are autofinding by a multi-segment index, place the autofind option on the last
entry_itemcommand that addresses a field that participates in the index. For autofind to work, it is necessary that values be in the screen buffer for all segments of the index, although it is not necessary that they be addressed byentry_itemcommands in the same order as they are in the index. The file definition forfilemust specify the search index as the Main Index forfile.field. -
If you want to execute an automatic find ge (greater than or equal to) command, use
autofind_ge. -
If
entry_itemcommands address another file(s) to whichfileis related as child, data from related record(s) in the parent file(s) will also be found and displayed. -
If used together with
findreq, autofind will require users to enter a valid existing key before continuing.