You need to sign in to do that
Don't have an account?
Admin Administrator
Validation Rule for Phone Numbers Country Code, Area Code and Number
I'm trying to create a validation rule for our phone numbers. Every number has 3 parts:
Country Code (numerical, 2 digit starts with '+') --> +49
Area Code (numerical, min. 2 digit, max 5 digits, cannot start with 0) --> 42; 421; 4218; 42189
Number (numerical, no digit limit, cannot start with 0)
Examples:
+49 123 1234567
Thanks for help.
Country Code (numerical, 2 digit starts with '+') --> +49
Area Code (numerical, min. 2 digit, max 5 digits, cannot start with 0) --> 42; 421; 4218; 42189
Number (numerical, no digit limit, cannot start with 0)
Examples:
+49 123 1234567
Thanks for help.
Country Code perfect. Number, too. But how is with Area Code? Area Code is not between 2-4. How can I figure min. 2 digit, max 5 digits?
Thanks for your help.
BR
Ehsan
Perfect. Thanks a lot.
BR
Ehsan
so I tested it in the Live org. I got following result:
Country Code (numerical, 2 digit starts with '+') --> +49 = "[+][0-9]{2}[' '] CORRECT
Area Code (numerical, min. 2 digit, max 5 digits, cannot start with 0) --> 42; 421; 4218; 42189 = [1-9]{2}[' '] THIS IS NOT CORRECT, because the 0 ist forbidden. So I can't have a Area code like: 4021 (0 is forbidden)
Number (numerical, no digit limit, cannot start with 0) = [1-9]*?")) IS ALSO INCORRECT, because 0 is forbidden.
Have a another IDEA?
br
Ehsan
Can you help with the formula that could allow only in these two formats:
(12) 34567890
(123) 4567890
consider only ten digits, the () and the space after "(" so the formula includes "(##) ########" or "(###) #######"
find the below solution
For Validation Rule you can refer to below Link:-
https://blog.bessereau.eu/assets/pdfs/salesforce_useful_validation_formulas.pdf
If you find this helpful mark it as the best answer