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
Craig CoulterCraig Coulter 

Phone number validation

Hi,

I want to restrict a lead from being saved if certain premium phone number codes are entered into the mobilephone or phone fields and prompt the user to enter a non premium phone number. Can this be achieved through a validation rule under the Lead object?

Thanks
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Criag,

Yes this is achievable using vallidation rules. Can you confirm what do you mean by premium numbers. Can you be more specific on it.

Thanks,
 
Craig CoulterCraig Coulter
Hi,

Thanks for the response. Premium, or business rate numbers, are numbers in the UK starting with 084, 033 etc and we want to stop the sales people from entering one of these numbers as a contact number for the new client and prompt them to get another phone number.

Thanks
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Craig,

Can you try the validadtio rule as below.
 
OR(CONTAINS('084', LEFT( Phone ,3)), CONTAINS('033', LEFT( Phone ,3)))

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,
Craig CoulterCraig Coulter
Hi,

Thanks for that. That seems to trigger the error message regardless of what number is entered.

Thanks