Set error properties for a control
You can set the validity and error message for the following controls using form actions to display invalid fields at runtime.
-
Textbox
-
Dropdown list
-
Calendar
-
Checkbox
When you configure an action on these touch and non-touch controls and drill into the properties, the IsValid and ErrorMessage properties are available. ErrorMessage accepts a string (default: Empty) value and IsValid accepts a boolean (default: True).
- Open a form.
- Add controls to the form, such as a Textbox or Checkbox.
-
Configure an action for the control, such as Business rule. See
Form actions.
When you call a business rule action on a form control and map the output of the business rule to the IsValid and ErrorMessage properties of the form field, at runtime, the business rule determines if the field value is valid. If IsValid = false, the field is highlighted as invalid and the message that is set in the ErrorMessage property is displayed when you move the pointer over the control.
When you call the action on a button that validates the form field, we recommend selecting the Causes validation property. For example, if an action sets the IsValid and ErrorMessage properties of a text box, then that action can only execute if there are no valid fields on the form when "Causes validation" is selected on the button. But, if there are any invalid fields on the form, clear the Causes validation property on the button the action is associated with.
The error message defined while configuring an action for the control takes precedence over the error message defined while configuring the properties of a control.