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
Kalpana WankhedeKalpana Wankhede 

Hi All, I am working on a scenario where i have Phone and mobile number should be of 10 digit. If value is null should not be mandatory

VinayVinay (Salesforce Developers) 
Hi Kalpana,

You can try below validation.
OR( 
NOT(ISBLANK(Phone__c ) ), 
NOT( REGEX( Phone__c , "[0-9]{10}") ) 
)

Please mark as Best Answer if above information was helpful.

Thanks,
Darshit Pathak 10Darshit Pathak 10

use below formula.

OR( 
   AND (
        NOT(ISBLANK(Phone)),
        NOT(REGEX( Phone , "[0-9]{10}"))
   ),
   AND (
        NOT(ISBLANK(Mobile)),
        NOT(REGEX( Mobile , "[0-9]{10}"))
   )
)

Please mark as Best Answer if above information was helpful.