ui.Dialog.nextField()

The NextField() method is used to specify the name of the field to which the cursor must go when the program control returns to the dialog. The method performance is similar to that of the NEXT FIELD statement, but it does not break the program workflow.

The NextField() method needs an argument which specifies the target field name. Therefore, the target field can be changed at runtime depending on the situation (key press, values, privileges etc.)

DEFINE str STRING,

       field1, field2 STRING

    ...

    ON ACTION ("switch")

          IF  str = check_val  THEN

              CALL DIALOG.nextField(field1)

              CONTINUE DIALOG

          ELSE

              CALL DIALOG.nextField(field2)

              CONTINUE DIALOG

          END IF

          CALL save_changes()