You need to sign in to do that
Don't have an account?
Anand Avinash Dosapati
how to check first 3 numbers of a phone number is equal to 011
Hello Gurus,
I am trying to write a validation rule on the standard Phone field which fulfils the following. The value should be accepted only if it starts with "001" otherwise a validation error should be thrown.
I have tried both the following and were successful in checking the prefix but failing in other cases.
1.
LEFT(Phone, 3) <> "001"
2.
AND(
NOT(ISBLANK(Phone)),
NOT(REGEX(Phone,"[001]{3}[1-9]{1}[0-9]{9}"))
)
I am trying to write a validation rule on the standard Phone field which fulfils the following. The value should be accepted only if it starts with "001" otherwise a validation error should be thrown.
I have tried both the following and were successful in checking the prefix but failing in other cases.
1.
LEFT(Phone, 3) <> "001"
2.
AND(
NOT(ISBLANK(Phone)),
NOT(REGEX(Phone,"[001]{3}[1-9]{1}[0-9]{9}"))
)
May I know in which cases, these are failing?
You could use:
AND(
NOT(ISBLANK(Phone)),
LEFT(Phone, 3) <> "001"
)
The result is the same for using the LEFT function alone and the one you have suggested.
It is throwing the error if the given prefix is neither or not provided.
I have one question here, LEFT being the string function could be used for PHONE fields?
0011 will not give Validation error, while 011 will give as it is checking as the prefix "001"
These are working.
LEFT(Phone, 3) <> "011"
NOT(LEFT(Phone, 3) ="011")
NOT(BEGINS(Phone, "001"))
it works
upsers (https://www.upsers.mobi/)
Airtel Customer Care (https://www.airtelcustomercarenumbers.in/)