+ Start a Discussion

Validation rule for Indian Phone number

Hi all,
I need Validation rule for indian format.
I have written this one, but it is raising the error while entering the phone number..

Please suggest me,
Thanks and Regards,
Anji reddy
Shashikant SharmaShashikant Sharma
Try this , it should work:
NOT(REGEX(Indian_Phone_Number__c, "[7-9]{1}[0-9]{9}"))

Let me know if you still have issue.

hi sharma,
Still it is raising the error.
It is  not allowing me to enter any number..
Please help me..
Thanks and regards,
Anji reddy
Shashikant SharmaShashikant Sharma
I could save any number starting from 7, 8, 9 with this formula. Could you share few examples which shold be allowed and giving error.
This is  the error i am gettingValidation rule for phone number please check this..
Please  check it..
Help me..
Thanks and regards,
Anji reddy.
Sandesh ReddySandesh Reddy
Hi Shashikanth,

I am getting same error as well, Could you please help me in this.

Nitin Gupta 219Nitin Gupta 219
Anjaneylu please check Your validation rule again You Write "[7-9]{1}{0-9]{9}" and correct is "[7-9]{1}[0-9]{9}".
The Square brackets [ ] Shows the range and { } for repitation right.
Igor PetrovychIgor Petrovych
Phone validation is quite complex subject. You can check out the code and docs for libphonenumber to get some insight. I think using a libphonenumber (http://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000G12oJUAR) port to parse/validate the number in the apex trigger would give you a more precise result. Regex will not handle all possible cases.
Himani Singh 1Himani Singh 1
I am creating screen flow in which validating input on phone no.
Used number field and formula  in that (NOT(REGEX({!Phone_No}, "[7-9]{1}[0-9]{9}")). )
But getting a warning saying: 
The formula expression is invalid: Incorrect argument type for function 'REGEX()'.
and if i am using text field then it is not validating my input.
Can anybody help?
s a8s a8
Hi Need help in writing a validation rule for contact number check  this is what i have written
NOT(REGEX( Contact_number__c ,"[7-9]{1}[0-9]{9}")), but it is showingban error message    Error: Incorrect argument type for function 'REGEX()'.
please help