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
Trif Cristian 7Trif Cristian 7 

multiselect picklist and formula field

Hi,

I have a multiselect picklist on my User Record called CountryAccess. User can select multiple countries in this field like: TH, BR. I also have another custom field called Country on my Account object which is a picklist field with all the countries. 

Now what I want is to create another formula field to check if the values from the Country contain the value from the CountryAccessand if yes, return TRUE otherwise FALSE.

Let's say for example a user X has 2 values TH and BR on CountryAccess field.  Now if I go to an account and the country is either TH or BR than display TRUE otherwise false.

 

Any ideas please? I manage to create a formula field but based on a picklist, with one value not multiselect...

Soyab HussainSoyab Hussain
Hi Trif Cristian,

Sorry we can't do this using formula field, because salesforce not supporting any field inside the INCLUDES() method.
But we can bind static values inside INCLUDE method.

Incorrect
IF( 
   INCLUDES($User.CountryAccess, Country), 
   true, false
)
Correct
IF( 
   INCLUDES($User.CountryAccess__c, "TD"), 
   true, false
)
If you wants this feature dynamically we have to use Process Builder Or Trigger.

If you found it useful please appreciate my efforts and mark it as the best answer.

LinkedIn: https://www.linkedin.com/in/soyab-hussain-b380b1194/  


Regards,
Soyab