+ Start a Discussion
Ravi BRavi B 

How to validate Mobile number of a custom field in custem object

Hi all,
  
  Can anyone help me to validate mobile number in a custom object i.e i have created one custem object inthat i added one field type as mobile custom filed data type is phone i want to give a validation to this field when i am saving that field by using javascript or formulat type

1 it must be 10 digts number and no spaces and no characters allow

 i checked with formul type validation it didnot showing any fiels type of my custom filed(mobile__c)

Thanks,
Ravi B
Ramu_SFDCRamu_SFDC
Use Regex for this validation

http://stackoverflow.com/questions/15938564/javascript-validate-phone-number-using-regex
dev_sfdc1dev_sfdc1
Hi Ravi,
You can use the formula in your validation Rule:


NOT(REGEX( Phone, "(\\d){10}"))

If it resolves, Please mark it as solution.