The Dialog class / ui.Dialog methods |
Check form level validation rules.
validate( field-list STRING ) RETURNING result INTEGER
Use the validate() method in order to execute NOT NULL, REQUIRED and INCLUDE validation rules defined in the form specification files.
Can the method by passing a list of fields or screen records as parameter.
The method returns zero if success and the input error code of the first field which does not satisfy the validation rules.
The current field is always checked, even if it is not part of the validation field list. This is mandatory, otherwise the current field may be left with invalid data.
If an error occurs, the validate() method automatically displays the corresponding error message, and registers the next field to jump to when the interactive instruction gets the control back.
The validate() method does not stop code execution if an error is detected. You must execute a CONTINUE DIALOG or CONTINUE INPUT instruction to cancel the code execution.
ON ACTION save IF DIALOG.validate("cust.*") < 0 THEN CONTINUE DIALOG END IF CALL customer_save()
For more details about field name specification, see Identifying fields in dialog methods.