AFTER INPUT block

The AFTER INPUT block is executed after the user has validated or canceled the INPUT dialog with the accept or cancel default actions, or when the ACCEPT INPUT instruction is executed.

The AFTER INPUT block is not executed when the EXIT INPUT instruction is performed.

This block is typically used to implement global dialog validation rules depending from several fields. If the values entered by the user do not satisfy the constraints, use the NEXT FIELD instruction to force the dialog to continue. The CONTINUE INPUT instruction can be used instead of NEXT FIELD, when no particular field has to be select.

Before checking the validation rules, make sure that the INT_FLAG variable is FALSE: in case if the user cancels the dialog, the validation rules must be skipped.

INPUT BY NAME cust_rec.*
   WITHOUT DEFAULTS ATTRIBUTES ( UNBUFFERED )
  ...

  AFTER INPUT
    IF NOT INT_FLAG THEN
       IF cust_rec.cust_address IS NOT NULL
          AND cust_rec.cust_zipcode IS NULL THEN
          ERROR "Address is incomplete, enter a zipcode."
          NEXT FIELD zipcode
       END IF
    END IF
END INPUT

To limit the validation to fields that have been modified by the end user, you can call the FIELD_TOUCHED() function or the DIALOG.getFieldTouched() method to check if a field has changed during the dialog execution. This will make your validation code faster if the user has only modified a couple of fields in a large form.