RegExpErrorMessage

XML Forms Guide

Version
R2024.2.1
RegExpErrorMessage

The <RegExpErrorMessage> tag works with the <RegExp> tag, outputting a customizable error message when regular expression validation fails on a string in an Employee Property Grid.

If the validation fails, the field is tagged on-screen, and your error message pops up when the user hovers over the field. If you use a <RegExp> tag without a <RegExpErrorMessage> tag, a standard error message displays: "[Field name]: field value does not match given Regex".

The following sample restricts a field to five lowercase letters, and outputs the custom error message "Only up to 5 lowercase letters are allowed":

Copy
<EPGridColumn>
    <BindingProperty>Value</BindingProperty>
    <XRefCode>EmployeePropertyXrefCode21</XRefCode>
    <IsRequired>True</IsRequired>
    <TextAlignment>Right</TextAlignment>
    <DefaultValue>az05</DefaultValue>
    <RegExp>^[a-z]{0,5}$</RegExp>
    <RegExpErrorMessage>Only up to 5 lowercase letters are allowed</RegExpErrorMessage>
</EPGridColumn>