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
Nithya YogeshNithya Yogesh 

preferred phone number field Validation Rule


 I have 4 phone fields, I need the preferred phone field to be a required field when more than 1 phone number is entered. 
Preferred phone number - should be entered ONLY when 2 or more phone numbers are entered. Any help is appreciated. TIA
AbhinavAbhinav (Salesforce Developers) 
Check this validation for your first scenario:
 
AND( OR(! ISBLANK( Phone1__c ),! ISBLANK( Phone3__c ),! ISBLANK( Phone3__c ) ) , ISBLANK( Preferred_Phone__c ) )

I did not clarity for 2nd as it seems contradicting with first .

Thanks!
PriyaPriya (Salesforce Developers) 
Hi Nithya,

Try this below :-
AND(
NOT(ISBLANK(Phone1) ),
NOT(ISBLANK(Phone2) ),
ISBLANK(Preferred_Phone) 
)

Here, Phone1 & Phone2 are the two other numbers. 

If this helps, please mark it as best answer.

Regards,

Priya Ranjan

mukesh guptamukesh gupta
Hi Nithya,

Please follow below formula:
NOT(ISBLANK(Phone1__c) ) && NOT(ISBLANK(Phone2__c) ) OR
NOT(ISBLANK(Phone1__c) ) && NOT(ISBLANK(Phone2__c) )  OR
NOT(ISBLANK(Phone1__c) ) && NOT(ISBLANK(Phone2__c) ) OR
AND ISBLANK( Preferred_Phone__c )

if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh 
Nithya YogeshNithya Yogesh
None of these could solve my problem. Thanks anyway, I should have been a little more clear. I did change these as per my condition and data type. Here is the actual scenario BTW, 
 4 number fields - phone numbers
1 picklist field - preferred phone number (has the options of all 4 Phone numbers)
Seems like a vague, too long formula to check for each combination of phone number and then select one of the numbers as Preferred.