Validating field input in complex scenarios
Create validation rules to check whether the data values that users enter meet specific criteria, and whether the system can process the information correctly.
While step validation supports relatively simple comparisons, validation rules help you create more complex operations that include functions and conditional processing. For example, a loan application might require different validation conditions depending on the risk rating of the applicant. You can set up a RiskLevel property with a value of High, Medium, and Low, and define a set of validation conditions for customers that represent High, Medium and Low risk levels.
- In the header of Dev Studio, click .
- On the New tab, define the label, context, and ruleset for the new validation rule, and then click Create and open.
- On the Input tab, define the input that the application
uses to determine which set of validation conditions to apply at run time:
- To define only one validation set, select None.
- To define a separate validation set for each value of a property, select Input property, and then select the target property.
- To define a separate validation set for each case status, select Proposed work status.
- To define a separate validation set for each flow action, select Flow Action Name.
- To define a separate validation set for each stage, select Stages.
- On the Validate tab, in the Property field, enter the property that you want to test.
- In the Conditions section, create a validation set by clicking Add.
- In the Validation conditions window, define the validation
set:
- Ensure that the Enable conditions check box is selected.
- Optional: To indicate that the user must fill out a field, select the Required check box.
- Optional: To force the system to evaluate subsequent properties even if the current evaluation fails, select the Continue validation check box.
- In Select a function, choose the function that you want to use to evaluate the property.
- In the fields below, enter the expression for the function.
- In the Message field, enter the text you want to display when the condition is true.
- Optional: To add an additional validation function, click Add a row, and then select a logical operator to link the functions.
- Click Submit
- If your validation rule includes multiple validation sets for different input
values, you can define additional validation sets:
- In the upper right corner of the Validate tab, click Add a new condition.
- In the Input row, enter the input value for which you want to create a validation set.
- Configure the validation set by completing steps 6.b through 6.h.
- Optional: To run another validation set after the current validation completes, in the Also execute row, specify the target validation set.
- Optional: To run additional validation rules after the current validation completes, in the Additional validation row, select the target validation rule.
- Click Save.
Previous topic Validating field values on a form Next topic Adding a validation rule to a flow action