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
SFDCneophyteSFDCneophyte 

Cross object formulas

I have a cross object formula that I'm trying to include a multi-select picklist to auto-populate a Text field on a custom object. But I'm getting an eror. If anyone can help it would be greatly appreciated.

 

-Thanks

 

INCLUDES( Lead__r.Product_Focus__c, "Investor", "Pro", "Maxit", "Financial Guidance", "Account Opening", "Money", "Movement", "Adv Trading", "Rules Engine","ENS", "Trading", "SDX for TurboTax", "FTS Professional Services", "Mobile", "Portfolio Rebalancing", "Web Services")

 

 Error: Incorrect number of parameters for function 'INCLUDES()'. Expected 2, received 17

Best Answer chosen by Admin (Salesforce Developers) 
phiberoptikphiberoptik

Sorry... I neglected that you were trying to populate a text field...

 

Your formula should be a series of nested IF() statements:

 

IF( INCLUDES(Multi_Select__c , "1"), "1",
   IF( INCLUDES(Multi_Select__c , "2"), "2",
      IF( INCLUDES(Multi_Select__c , "3"), "3",
null)))

 

All Answers

phiberoptikphiberoptik

INCLUDES(multiselect_picklist_field, text_literal) means that it only looks at one text_literal within the function. You need to create an OR() statement around each of these. For example:

 

OR(
   INCLUDES( Lead__r.Product_Focus__c, "Investor"), 
   INCLUDES( Lead__r.Product_Focus__c, "Pro"), 
   INCLUDES( Lead__r.Product_Focus__c, "Maxit"), 
   INCLUDES( Lead__r.Product_Focus__c, "Financial Guidance"), 
   INCLUDES( Lead__r.Product_Focus__c, "Account Opening")
) 

 

Just continue by adding each picklist option as a new line before the end parenthesis. Make sure to add a comma after each line except the last.

SFDCneophyteSFDCneophyte

Thank you,  I plugged in that formula and received an error.

 

 Error: Formula result is data type (Boolean), incompatible with expected data type (Text).

jd123jd123

Hi

 

  

INCLUDES(multiselect_picklist_field, text_literal)

Determines if any value selected in a multi-select picklist field equals a text literal you specify.

it will return only TRUE OR False.

 

see an error

 Incorrect number of parameters for function 'INCLUDES()'. Expected 2, received 17

 

you can check only one value wether it is true or false.

 

 for more details

 

 

https://ap1.salesforce.com/help/doc/user_ed.jsp?section=Customizing&target=customize_functions.htm%23INCLUDES&loc=help&instance=AP1&release=178.21.5

 

 

phiberoptikphiberoptik

Sorry... I neglected that you were trying to populate a text field...

 

Your formula should be a series of nested IF() statements:

 

IF( INCLUDES(Multi_Select__c , "1"), "1",
   IF( INCLUDES(Multi_Select__c , "2"), "2",
      IF( INCLUDES(Multi_Select__c , "3"), "3",
null)))

 

This was selected as the best answer
SFDCneophyteSFDCneophyte

Thank you! This was the solution....