+ Start a Discussion
Bharath Kumar Reddy GunnaBharath Kumar Reddy Gunna 

Validation Rule for Multi-Select Picklist field.

I need a validation rule for Multi Picklist to prevent users from uploading values other than the defined Multiselect picklist values.

For example I have 5 values defined for MSP, howwever users can upload any othe values from API and I need to restrict that.

Thanks
Amit Chaudhary 8Amit Chaudhary 8
You could add a Validation Rule like this:

IF(INCLUDES(Multi_Picklist__c, "A"),1,0) + 
IF(INCLUDES( Multi_Picklist__c, "B"),1,0) + 
IF(INCLUDES( Multi_Picklist__c, "C"),1,0) + 
IF(INCLUDES( Multi_Picklist__c, "D"),1,0) + 
IF(INCLUDES( Multi_Picklist__c, "E"),1,0) > 3

Related Link:-
https://success.salesforce.com/answers?id=90630000000h1cIAAQ
https://developer.salesforce.com/forums/ForumsMain?id=906F00000008xCGIAY
https://developer.salesforce.com/forums/ForumsMain?id=906F00000008xKlIAI
https://help.salesforce.com/apex/HTViewHelpDoc?id=tips_for_using_picklist_formula_fields.htm&language=en_US
https://success.salesforce.com/answers?id=90630000000gxPoAAI

If this makes your solution , mark this as a solution for other's reference..!

 
Bharath Kumar Reddy GunnaBharath Kumar Reddy Gunna
Hi Amit,

Picklist values are A, B, C, D, E. 
Through API I can set any other value other than above 5. 
So I need a validation rule which will fire if users are setting any value other than above 5 
for example through API if users are insertinng A;C;Z , then it should throw an error.

 
Sakthivel ThandavarayanSakthivel Thandavarayan
Try like this,

NOT( 
OR( 
INCLUDES( Field__c, 'A'), 
INCLUDES( Field__c, 'B'), 
INCLUDES( Field__c, 'C'), 
INCLUDES( Field__c, 'D'), 
INCLUDES( Field__c, 'E') 

)