You need to sign in to do that
Don't have an account?

Custom Phone field validation and auto Format ?
I have defined a custom phone field (Type is Phone). When user enters 1234567890, it should be validated - Numeric, Should be 10 digits only, if the validation is ok, when we press enter, it should be formatted as (123) 456-7890. How this can be done please ?
There's a great example in the Useful Validation Rules guide that you can copy (page 15)
US Phone Number Has Ten Digits Field Value Validates that the Phone number is in (999) 999-9999 format. This works by using the REGEX function to check that the number has ten digits in the (999) 999-9999 format.
Description: Formula: Error Message: US phone numbers should be in this format: (999) 999-9999.
Error Location: Phone
Hope this helps.
Kindly mark this as solved if the reply was helpful so that it gets removed from the unanswered queue which results in helping others who are facing a similar issue.
Thanks,
Nagendra
All Answers
There's a great example in the Useful Validation Rules guide that you can copy (page 15)
US Phone Number Has Ten Digits Field Value Validates that the Phone number is in (999) 999-9999 format. This works by using the REGEX function to check that the number has ten digits in the (999) 999-9999 format.
Description: Formula: Error Message: US phone numbers should be in this format: (999) 999-9999.
Error Location: Phone
Hope this helps.
Kindly mark this as solved if the reply was helpful so that it gets removed from the unanswered queue which results in helping others who are facing a similar issue.
Thanks,
Nagendra
If you wanted to do just formatting along with validation rule , you need to override the custom component or page to do this ..
Remove the standard filed from the layout and add the page or component ( You can perform validation on the page or component )
Description:
NOT(REGEX(Phone, "\\D*?(\\d\\D*?){10}"))