More about Edit Validate rules
|
|
If an input field is blank, the edit validate rule associated with the property is not called. You can't create an edit validate rule that checks whether a value is empty.
Constraints rules provide a useful alternative to edit validate rules, especially for properties that may be updated both by computations and by direct user input.
Don't confuse edit validate processing with edit input processing:
The property value (stored in the variable theValue
) that is input to edit validate processing may not be what the user typed, if an edit input transformation is associated with the property.
You can create edit validate rules that use regular expression pattern matching to validate user inputs. See PDN article How to use regular expressions to validate user input.
The standard text file rule named webwb.pega_validators.js includes JavaScript functions that exactly emulate a few standard edit validate rules. When enabled appropriately, these JavaScript functions are incorporated into user forms and flow actions, supporting client-side validation of user inputs, before a user submits the form.
If desired, you can build a similar capability for an edit validate rule in your application RuleSet. JavaScript skills are required.
When an input value fails validation by an edit validate rule, the system adds the message rule named PropertyInfo-EditValidate to the property. The default text is
Invalid value specified for {1}.
where {1} identifies the property.
Click Actions > View Java to view the generated Java of a rule. You can use the Java code to debug your application or to examine how rules are implemented.