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
DipthiDipthi 

Validation rule on Contact & Account

Hi ,

I am struck on my validation Rule. seeing the below error msg.
Error : Field Type is a picklist field. Picklist fields are only supported in certain functions. 


REQ: I have a multi-picklist field 'Permissions' on Contact and picklist field 'Account type' on Account. I can only select value 'unlimited' from 'Permissions' only if Account type = VIP/IMP

AND(

NOT(

OR(
ISPICKVAL(Account.Type = ‘VIP’), ISPICKVAL(Account.Type = ‘IMP’) ),

INCLUDES(Partner_User_Permissions__c , 'Unlimited')

)

Message : only contct with VIP & Imp Account type can have 'unlimited' permissions
 
Best Answer chosen by Dipthi
AnkaiahAnkaiah (Salesforce Developers) 
Hi Dipthi,

try with below
 
AND(
OR(NOT(ISPICKVAL(Account.Type, "VIP")),NOT(ISPICKVAL(Account.Type, "IMP"))),

INCLUDES(Partner_User_Permissions__c , "Unlimited")

)

If this helps, please mark it as best answer.

Thanks!!​​​​​​​

All Answers

AnkaiahAnkaiah (Salesforce Developers) 
Hi Dipthi,

try with below
 
AND(
OR(NOT(ISPICKVAL(Account.Type, "VIP")),NOT(ISPICKVAL(Account.Type, "IMP"))),

INCLUDES(Partner_User_Permissions__c , "Unlimited")

)

If this helps, please mark it as best answer.

Thanks!!​​​​​​​
This was selected as the best answer
AnkaiahAnkaiah (Salesforce Developers) 
Hi Dipthi,

Please try with below 
 
AND(
OR(TEXT(Account.Type) <>  'VIP',
TEXT(Account.Type) <> 'IMP'),
INCLUDES(Partner_User_Permissions__c , 'Unlimited')
)
If this helps, Please mark it as best answer.
 
DipthiDipthi
Thank you very much Ankaiah. I was thinking soo much looking where I went wrong. Its the  '='  used in ISPICKVAL

AND(
OR(
NOT(ISPICKVAL(Account.Type ,'VIP')) , 
NOT(ISPICKVAL(Account.Type ,'IMP'))  ),

INCLUDES(Partner_User_Permissions__c , 'Unlimited')
)