FIELD_TOUCHED()

The FIELD_TOUCHED() operator checks if fields were modified during the dialog execution.

Syntax

FIELD_TOUCHED (
   { [group.]field.*
   | group.*
   | *
   } [,...] )
  1. group can be a table name, a screen record, a screen array or FORMONLY as defined in the form.
  2. field is the name of the field as defined 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.

When used in an INPUT ARRAY instruction, the runtime system assumes that you are referring to the current row.

Do not confuse the FIELD_TOUCHED() operator with the fgl_buffertouched() built-in function; which checks a different field modification flag, that is reset when entering the field.

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.

Without group prefix, the operator will use a matching field name, by ignoring the prefix used in the form file or in the FROM clause of the dialog instruction.

When used, the group prefix is a table name, screen record, screen array or the FORMONLY keyword as defined in the form file. The group prefix to be specified depends on the type of variable-to-field binding used by the dialog instruction:

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, see Input field modification flag.

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
  ...