You need to sign in to do that
Don't have an account?
Phone number Validation in Salesforce
Please help me regarding this validation ,
in the phone field we could enter only 10 digit not more or less than 10 digit and not contain any chanracter and i have created a validation which is as follow but in this there is a problem if we enter a number like 1234567891as then it not showing any error and for every condition it is perfect, please help me.
my validation is:
IF (not(isblank(Phone)),OR(NOT(REGEX(Phone , "\\D*?(\\d\\D*?){10}")), NOT(ISNUMBER(Phone))),NULL)
in the phone field we could enter only 10 digit not more or less than 10 digit and not contain any chanracter and i have created a validation which is as follow but in this there is a problem if we enter a number like 1234567891as then it not showing any error and for every condition it is perfect, please help me.
my validation is:
IF (not(isblank(Phone)),OR(NOT(REGEX(Phone , "\\D*?(\\d\\D*?){10}")), NOT(ISNUMBER(Phone))),NULL)
In Validation Rule, the result of your criteria need to be true or false.
So do not use if, but AND and OR operators
more like :
AND(not(isblank(Phone)),OR(NOT(REGEX(Phone , "\\D*?(\\d\\D*?){10}")), NOT(ISNUMBER(Phone))))
regards,
jerome
Check this - http://www.infallibletechie.com/2015/01/validation-for-10-digit-phone-number-in.html
Finally i got the solution for this situation:
for this first creat a formula field of text data type and the formula field is:
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(Phone, "(", ""), ")", ""), " ", ""), "-", "")
and after that create a validation rule on this formula field and validation rule is:
OR(NOT(REGEX(Phone_F__c , "\\D*?(\\d\\D*?){10}")), NOT(ISNUMBER(Phone_F__c)))