INFIELD()
The INFIELD() operator
checks for the current screen field.
Syntax
INFIELD ( [group.]field )
- group can be a table name, a screen record, a screen array
or
FORMONLYas defined in the form. - field is the name of the field as defined in the form.
Usage
INFIELD() checks for the current field in a CONSTRUCT,
INPUT or INPUT ARRAY dialog.
When used in an INPUT ARRAY instruction, the runtime system assumes
that you are referring to the current row.
For a generic equivalent, use the DIALOG.getCurrentItem() method.
When using
INFIELD(field) without group prefix, the
operator will check if the current field name matches, by ignoring the prefix used in the form file
or in the FROM clause of the dialog instruction.
When using
INFIELD(group.field), the
group prefix must be a table name, screen record, screen array or the
FORMONLY keyword as defined in the form, and its usage depends on the type of
variable-to-field binding used by the dialog instruction:- When using the
BY NAMEclause as inINPUT var-list BY NAMEorCONTRUCT BY NAME sql-cond ON column-list, no field prefix can be used. Even if the field name matches,INFIELD(group.field)will returnFALSE. - When using the
FROMclause as inINPUT var-list FROM field-list,CONTRUCT sql-cond ON column-list FROM field-listorINPUT ARRAY arr-name FROM scr-array.*, the field prefix must match the table name, screen record or screen array used in theFROMclause.
Example
INPUT BY NAME rec.*
...
ON ACTION check
IF INFIELD( custname ) THEN
CALL check_customer_name( rec.custname )
...