Validation rule for phone numbers
Submitted by Matt C on Thu, 01/02/2018 - 17:49
Hey guys,
I was wondering if anyone knew how to set a validation rule for phone number that only allowed numbers [0-9]. Our staff have a disturbing tendency to write notes in there.....
Do I add an assertion descriptor, namely assertion.number?
Cheers,
Matt
Re: Validation rule for phone numbers
You need to add a regularExpression assertion to the contact.phoneNumber archetype. e.g.:
or:
The first form only allows digits. The second is more flexible, but won't work for 13 and 18 numbers so you will need to experiment with it.
Re: Validation rule for phone numbers
Thanks heaps Tim.
That worked a treat!
I used the restrictive form (first). The "Name" field provides all the capacity for annotation we need.
Cheers,
matt