AFTER CONSTRUCT block

Use an AFTER CONSTRUCT block to execute instructions after the user has finished search criteria input.

AFTER CONSTRUCT is not executed if an EXIT CONSTRUCT is performed.

The code in AFTER CONSTRUCT can for example check if a criteria combination of different fields is required or denied, and force the end use to enter all

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

Since no program variables are assicioted to the form fields, you must query the input buffers of the fields to get the values entered by the user.

CONSTRUCT BY NAME where_part ON ...
  ...
  AFTER CONSTRUCT
    IF NOT INT_FLAG THEN
       IF LENGTH(DIALOG.getFieldBuffer(cust_name))==0
       OR LENGTH(DIALOG.getFieldBuffer(cust_addr))==0 THEN
          ERROR "Enter a search criteria for customer name and address fields."
          NEXT FIELD CURRENT
       END IF
    END IF
END CONSTRUCT

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.