The following procedure shows you how to validate data to check whether three separate conditions are met. The procedure allows you to perform multiple checks on the data and return a number of different outcomes before performing the secondary action, which is to run the Validate action. As a result, the code structure follows the following format:
- Action: Select
- Invoke: Subfunction
- Subfunction: Checks the data and performs the secondary action
To validate data
- Perform a Select action to return a set of data.
- Invoke the CheckValidation function, to check the following:
- Check if field 1 is greater than field 2. If not, then set the result to False and display message A.
- Check if field 3 is equal to field 4. If not, then set the result to False and display message B.
- Check if field 5 is less than field 6. If not, then set the result to False and display message C.
- Otherwise, set the result to True.
Execute a Validate action from within the CheckValidation function, and then insert the result from the query in Step 2 to either allow the record to be saved (True) or to return the user to the data entry (False) page.