You need to sign in to do that
Don't have an account?
aaryan sri
phone validation
HI,
Am trying to restrict phone no to 10 digits and i should accept format either (999) 999-9999 or 999-999-9999 or 999999999.
I wrote below validation
AND(
NOT(ISBLANK(Prescriber_Phone_Number_Last_Fill_Date__c)),
NOT(
OR(
ISNUMBER(Prescriber_Phone_Number_Last_Fill_Date__c ),
REGEX(Prescriber_Phone_Number_Last_Fill_Date__c,"[0-9]{3}-[0-9]{3}-[0-9]{4}"),
REGEX(Prescriber_Phone_Number_Last_Fill_Date__c, "\\D*?(\\d\\D*?){10}"),
REGEX(Prescriber_Phone_Number_Last_Fill_Date__c, "[0-9]{10}")
)
)
)
It is allowing more than 10 and Alphabets .
Can somebody help me how to fix this?
Am trying to restrict phone no to 10 digits and i should accept format either (999) 999-9999 or 999-999-9999 or 999999999.
I wrote below validation
AND(
NOT(ISBLANK(Prescriber_Phone_Number_Last_Fill_Date__c)),
NOT(
OR(
ISNUMBER(Prescriber_Phone_Number_Last_Fill_Date__c ),
REGEX(Prescriber_Phone_Number_Last_Fill_Date__c,"[0-9]{3}-[0-9]{3}-[0-9]{4}"),
REGEX(Prescriber_Phone_Number_Last_Fill_Date__c, "\\D*?(\\d\\D*?){10}"),
REGEX(Prescriber_Phone_Number_Last_Fill_Date__c, "[0-9]{10}")
)
)
)
It is allowing more than 10 and Alphabets .
Can somebody help me how to fix this?
Try this once
AND( NOT(ISBLANK(Phone)), LEN(Phone) < 10 )
Try this once
OR(NOT(REGEX( Phone , "\\D*?(\\d\\D*?){10}")), NOT(ISNUMBER( Phone )))
It contains only ten digits not more than or not less than.
Thanks
Neeraj
I fixed my issue with below changes and it start working what am looking the formates.
AND(
If(
ISBLANK(Prescriber_Phone_Number_Last_Fill_Date__c),Null,
NOT(
OR(
REGEX(Prescriber_Phone_Number_Last_Fill_Date__c,"[0-9]{3}-[0-9]{3}-[0-9]{4}"),
REGEX(Prescriber_Phone_Number_Last_Fill_Date__c,"\\([0-9]{3}\\)-[0-9]{3}-[0-9]{4}"),
REGEX(Prescriber_Phone_Number_Last_Fill_Date__c,"[0-9]{10}")
)
)
)
),