why is it possible for "must match regexp" but not for "must be one of the following values only"
We added custom error messages for regular expressions because it is hard to give a generic error message when regular expressions are used. Regular expressions may check for many things, and ordinary users are not supposed to be good at regular expressions. So, an error message saying that the value should correspond to this or that regular expreession may be very confusing.
In any case, thanks for the suggestion. Maybe, we'll make the option of setting custom error message for all constraint types, not only for 'Must match regular expression'.
Is there at least an option to clear the Office field up front before it is populated, maybe with a business rule or something?
A Business Rule cannot be used in this case for the following reasons:
- A Business Rule cannot be triggered on opening the form for editing users.
- If you create a Business Rule triggered before updating a user, and there is a constraint violation on the page for editing users, the Business Rule will not be triggered because the operation will be terminated even before any Business Rules are applied.
What you can do in this case is to create a Scheduled Task that will check for each user whether the value of the Office property is allowed by the Property Pattern and will delete the Office property if the value is not allowed.