I wanted to write a validation rule for default Phone field.
AND(
NOT(ISBLANK( Phone )),
NOT(ISNUMBER( Phone ))
)
it works fine but allows only 9 digits.
What could be the problem?
When i Deactivate this validation rule, it accepts more than 10 digits or alphabets.
Why is the Number restriction enforced?
Best Answer
Ten digit numbers are automatically reformatted as '(###) ###-####', which means that ISNUMBER will return false (because it has spaces, parentheses, and a hyphen). Also, when you see the documentation, you'll see it also supports numbers like 2e2 or 123.123, which are both numbers, but not phone numbers.
So, what you're probably looking for, for a start, is two specific patterns that will match US and other numbers:
You'll want to experiment with REGEX to determine which rule(s) you'd like to follow.