function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Yuvi TrialYuvi Trial 

Validate digit of phone number not to be same value

If all digits of phone number have same value (example 111-111-1111, 222-222-2222, etc.) then the record should not be created or saved.
Best Answer chosen by Yuvi Trial
AG_SFDCAG_SFDC
Hi Yuvi,

Please refer to the following link:
https://help.salesforce.com/apex/HTViewSolution?id=000187896&language=en_US

Please mark it as best answer if it solved your request.

Thanks,
AG

All Answers

AG_SFDCAG_SFDC
Hi Yuvi,

Please refer to the following link:
https://help.salesforce.com/apex/HTViewSolution?id=000187896&language=en_US

Please mark it as best answer if it solved your request.

Thanks,
AG
This was selected as the best answer
Cebeerdes NicholsCebeerdes Nichols
When you are entering in a phone number, it is important to make sure that you are entering in the correct number of digits. The number 44 (https://spiritualfeel.com/angel-number-44-meaning/) in this phone number indicates that there should be 10 digits total. If you enter in fewer or more digits, the number will not be valid.

Validating the digits of a phone number is an important task for any organization that relies on phone numbers for communication. There are a few different ways to validate the digits of a phone number, and the most common method is to use a regular expression.

A regular expression is a sequence of characters that defines a search pattern. In this case, we can use a regular expression to search for a pattern of 10 digits in a phone number. If the phone number matches the pattern, then it is a valid phone number.

There are many online resources that you can use to test your regular expression. I like to use Regex101 because it has a great testing tool and a large community of users who can help you if you get stuck.

Once you have a regular expression that correctly validates the digits of a phone number, you can use it in your code to validate phone numbers entered by users. This is a great way to ensure that your users are entering valid phone numbers, and it can help you avoid any potential problems that could arise from invalid phone numbers.