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
FORMONLY
as 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 NAME
clause as inINPUT var-list BY NAME
orCONTRUCT 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
FROM
clause as inINPUT var-list FROM field-list
,CONTRUCT sql-cond ON column-list FROM field-list
orINPUT ARRAY arr-name FROM scr-array.*
, the field prefix must match the table name, screen record or screen array used in theFROM
clause.
Example
INPUT BY NAME rec.*
...
ON ACTION check
IF INFIELD( custname ) THEN
CALL check_customer_name( rec.custname )
...