Web Client-Side Validation

When performing database operations in web applications, there can be slight delay before table validation results are returned from the server to the application.

To avoid this delay you can use the Validate method which instantly checks a field or fields against the field and table rules defined in the repository. The method uses simple field and table rules defined for insert, update or delete. Complex logic and lookup rules are not supported.

The Validate method can be used with these components:

      Edit Field (PRIM_MD.EditField) - Validates the field

      Dialog (PRIM_DLG) - Validates the fields in the dialog

      View (PRIM_VIEW) - Validates the fields in the view

Parameters are:

      Valid (*Result) - returns true if the field passes the validation rules

      Operation (*Input) - The operation for the field to be validated (insert, update and delete)

      File (*Input) - Table for field to be validated against.

      For example, to validate the fields which appear on a Dialog's panel for update, against the Employee table:

#Dialog.Validate(Update #xEmployee)

     

For more information and sample code see View Validate Method, Dialog Validate Method and Edit Field Validate Method.