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
p sonwanep sonwane 

Error: Field Sales_Org__c is a picklist field. Picklist fields are only supported in certain functions. Tell me more

checkbox should be checked if the logged in user sales org and Product Sales org matches. sales org is picklist feild in user object and multislect feild in product object . i have written below formula but getting error
formula :
IF($User.Sales_Org__c = Sales_Org__c , true, false)

error : 
 Error: Field Sales_Org__c is a picklist field. Picklist fields are only supported in certain functions. Tell me more
Best Answer chosen by p sonwane
SteveMo__cSteveMo__c
PS if one of the field is a Multi-Select Picklist, then you will need to write an INCLUDES Function for each one of the Multi Picklist Values like this
 
OR(
IF( INCLUDES( MultiPicklist , 'A' ), 'A', NULL) = TEXT(Picklist ),
IF( INCLUDES( MultiPicklist , 'B' ), 'B', NULL) = TEXT(Picklist ),
IF( INCLUDES( MultiPicklist , 'C' ), 'C', NULL) = TEXT(Picklist ),
IF( INCLUDES( MultiPicklist , 'D' ), 'D', NULL) = TEXT(Picklist )
)

 

All Answers

Sai PraveenSai Praveen (Salesforce Developers) 
Hi Sonwane,

Can you confirm if Sales_Org__c in User object is also a picklist field?

Thanks,
 
p sonwanep sonwane
Hi Praveen, Sales_org__c is picklist field on user object and multiselect picklist field on product object with same value
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Sonwane,

It may not be possible with single field as we have to use Includes() for multiselect picklist but  it only accepts text literal for comparision. But here it is not Text literal but seperate field.

Thanks,
 
SteveMo__cSteveMo__c
To compare Picklist Fields you must convert them using a TEXT function.  Also Checkbox fields are boolean, so there is no need to specify True/False.  

Like this
TEXT($User.Sales_Org__c)  = TEXT( Sales_Org__c)

 
SteveMo__cSteveMo__c
PS if one of the field is a Multi-Select Picklist, then you will need to write an INCLUDES Function for each one of the Multi Picklist Values like this
 
OR(
IF( INCLUDES( MultiPicklist , 'A' ), 'A', NULL) = TEXT(Picklist ),
IF( INCLUDES( MultiPicklist , 'B' ), 'B', NULL) = TEXT(Picklist ),
IF( INCLUDES( MultiPicklist , 'C' ), 'C', NULL) = TEXT(Picklist ),
IF( INCLUDES( MultiPicklist , 'D' ), 'D', NULL) = TEXT(Picklist )
)

 
This was selected as the best answer
p sonwanep sonwane
its wroked for me thank you @steveMo__c