Validation
Validations include minimum, maximum, and increment values for number fields, maximum length validation for text fields, and informational messages that provide feedback.
Messages in CPQ are categorized into three types: Critical (prevents progression), Warning (not used in Rhythm for Civics), and Informational (provides helpful feedback without interrupting workflow).
Client-side validation
Client-side validation happens in the browser before any call is made to the server. These client-side validations are supported in Rhythm for Civics:
- Required: To make a field required, select the Required check box in the field properties.
- Range: You can specify a range for a number field, such as between 1 and 10, in Design Studio. Both a minimum and a maximum are required.
Note: You can specify multiple ranges in Design Studio, but only the first one is supported in Rhythm for Civics.
- Max length: To configure a maximum length for text fields, use a message rule in the ruleset. This applies to text fields and text areas only.
For text fields, the maximum length will prevent the user from typing more than the specified number of characters. For text areas, it will add a character count to the bottom of the text area.
To set the maximum length, specify these properties for the message rule:
- Message Level: Informational
- Value: The field that the rule applies to
- Title:
__maxlength__ =(number of characters)=
Server-side validation
Server-side validation is handled through message rules configured in the CPQ ruleset. When a user attempts to move to the next screen in the wizard, the system sends the current selections to the CPQ REST service, which evaluates the rules and returns validation messages (informational or critical). These messages are processed and displayed to the user, with Critical messages blocking progression to the next step.
To configure server-side validation, add a message to your ruleset under the screen where the target field will be shown.
Specify these values for an informational message:
- Condition: Specify the condition to be checked. For example,
=SquareFoot !=5is a simple check to ensure that the specified area is less than 5 square feet. - Message Level: Informational
- Title:
__SERVERVALIDATION__ [Error message to be displayed on the field]
Specify these values for a critical message:
- Condition: Specify the condition to be checked.
Note: The equation in the Condition field should result in true if any of the informational messages used for server-side validation are true. If you have two server-side validations, the alert should have its condition set to something like:
=[first message rule condition] OR [second message rule condition] - Message Level: Critical
Note: A critical message will pause execution, so the message must be after everything that should be processed before the pause.
- Value: Must be unique among all critical messages in workflow.
- Title: Not used for critical messages.