URGENT HELP: Validation Rule for Multi-Select Field - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Marcus YapMarcus Yap 

URGENT HELP: Validation Rule for Multi-Select Field

Dear all SF experts,

I need an urgent help here. I need to create a validation rule for a Multi-Select field.

Case:
If no one select any metadata for "Application Type" field (Multi-Select field type), then "Other Application Type" field (Text field) becomes a mandatory field or must key-in value field.

Appreciate anyone can help me at the soonest! Thank you very much.
Best Answer chosen by Marcus Yap
Eric PraudEric Praud
You need the INCLUDES function for a MS picklist:
AND(INCLUDES(Application_Type__c,"Others"), ISBLANK(Other_Application_Type__c))

If you want to make Other_Application_Type__c mandatory when the MS picklist is also blank:
​​​​​​​AND(OR(ISBLANK(Application_Type__c),INCLUDES(Application_Type__c,"Others")), ISBLANK(Other_Application_Type__c))

​​​​​​​

All Answers

Eric PraudEric Praud
Hi Marcus,

Try this:
AND(ISBLANK(Application_Type__c), ISBLANK(Other_Application_Type__c))

 
Marcus YapMarcus Yap
Hi Eric,

Once again, thank you very much for your swift response. If I have another scenario, which is 

If someone select a metadata of "Others" for "Application Type" field (Multi-Select field type), then "Other Application Type" field (Text field) becomes a mandatory field or must key-in value field.

I try to do the following:

AND(ISPICKVAL(Application_Type__c,"Others"), ISBLANK(Other_Application_Type__c)),

there is an error of 
Error: Field Application_Type__c is a multi-select picklist field. Multi-select picklist fields are only supported in certain functions

Could you please advise?

Thank you again.
Eric PraudEric Praud
You need the INCLUDES function for a MS picklist:
AND(INCLUDES(Application_Type__c,"Others"), ISBLANK(Other_Application_Type__c))

If you want to make Other_Application_Type__c mandatory when the MS picklist is also blank:
​​​​​​​AND(OR(ISBLANK(Application_Type__c),INCLUDES(Application_Type__c,"Others")), ISBLANK(Other_Application_Type__c))

​​​​​​​
This was selected as the best answer
Marcus YapMarcus Yap
Hi Eric,

Thank you again and again.

Yes, it works. You are brilliant. You save many hours of my life!!! I am trying to ask Mr. Google for a few hours but can't find the right answer.

Cheers. 
Eric PraudEric Praud
Glad I could help :)