ui.Dialog.nextField

Registering the next field to jump to.

Syntax

nextField(
   name STRING )
  1. name is the form field name.

Usage

The nextField() method registers the name of the next field that must get the focus when control goes back to the dialog.

The first parameter identifies the form field, see Identifying fields in dialog methods for more details.

This method is similar to the NEXT FIELD instruction, except that it does not implicitly break the program flow. If you want to get the same behavior as NEXT FIELD, the method call must be followed by a CONTINUE DIALOG instruction, or an equivalent instruction, in case of singular dialog.

Since this method takes an expression as parameter, you can write generic code, when the name of the target field is not known at compile time. In the next example, the check_value() function returns a field name where the value does not satisfy the validation rules.
DEFINE fn STRING
...
ON ACTION save 
  IF ( fn:= check_values() ) IS NOT NULL THEN
    CALL DIALOG.nextField(fn)
    CONTINUE DIALOG
  END IF
  CALL save_data()
  ...