FIELD_TOUCHED()
The FIELD_TOUCHED()
operator
checks if fields were modified during the dialog execution.
Syntax
FIELD_TOUCHED (
{ [group.]field.*
| group.*
| *
} [,...] )
- group can be a table name, a screen record,
a screen array or
FORMONLY
. - field is the name of the field in the form.
Usage
FIELD_TOUCHED
returns TRUE
if
the value of a screen field (or multiple fields) has changed
since the beginning of the interactive instruction.
The operator
accepts a list of explicit field names, and supports the [group.]*
notation in order to check multiple fields in a single evaluation.
When passing a simple asterisk (*
) to the
operator, the runtime system will check all fields used by the
current dialog.
When used in an INPUT ARRAY
instruction,
the runtime system assumes that you are referring to the current
row.
The FIELD_TOUCHED
operator can only
be used inside an INPUT
, INPUT ARRAY
and CONSTRUCT
interaction
block.
For more details about the FIELD_TOUCHED
operator
usage and the understand the "touched flag" concept, refer
to the definition of the DIALOG
instruction.
Do not confuse the FIELD_TOUCHED
operator withFGL_BUFFERTOUCHED
built-in function; which checks a different field modification
flag, that is reset when entering the field. The global touched
flag controlled by FIELD_TOUCHED
is reset when the
dialog starts or when DIALOG.setFieldTouched()
is
used.
Example
INPUT ...
...
AFTER FIELD custname
IF FIELD_TOUCHED( customer.custname ) THEN
MESSAGE "Customer name was changed."
END IF
...
AFTER INPUT
IF FIELD_TOUCHED( customer.* ) THEN
MESSAGE "Customer record was changed."
END IF
...