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
Kathleen Munetz-Vasquez 3Kathleen Munetz-Vasquez 3 

Multi Select Picklist formula.

I have created a formula field for a Multi select picklist and the formula I wrote is not working the error reads "Error: Incorrect parameter type for operator '+'. Expected Number, received Text". I know it's because of the opportunity ID number but how else can I write this? Here's what the formula looks like:

IF(INCLUDES(  Opportunity_Number__r.Grant_Opportunity_Type__c  , "Appropriation"), "Appropriation" + BR(), null) +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "Brazil Market Entry Grant"), "Brazil Market Entry Grant" , + BR(), null) +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "DIG - Defense Infrastructure Grant"), "DIG - Defense Infrastructure Grant", + BR(), null) +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "DRG - Defense Reinvestment Grant"), "DRG - Defense Reinvestment Grant", + BR(), null) +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "DTF - Defense Task Force"), "DTF - Defense Task Force",  + BR(), null) +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "FL Trade Grant"), "FL Trade Grant", + BR(), null) +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "Foreign International Offices"), "FSF Event Market Assistance", + BR(), null) +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "FSF Event Market Assistance"), "DIG - Defense Infrastructure Grant", + BR(), null) +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "FSF Major & Regional Grant Program"), "FSF Major & Regional Grant Program", + BR(), null) +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "General Services"), "General Services", + BR(), null) +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "Investment"), "Investment", + BR(), null) +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "Other Income"), "Other Income", + BR(), null) +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "PTE Grant"), "PTE Grant", + BR(), null) +

 
Best Answer chosen by Kathleen Munetz-Vasquez 3
Alain CabonAlain Cabon
Hi Kathleen,

There are just extra commas ( "Brazil Market Entry Grant" , + BR(), null)  should be  "Brazil Market Entry Grant"  + BR(), "")
And an extra "+" at the end (useless).

Nothing serious, things will be better like below.
 
IF(INCLUDES(  Opportunity_Number__r.Grant_Opportunity_Type__c  , "Appropriation"), "Appropriation" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "Brazil Market Entry Grant"), "Brazil Market Entry Grant" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "DIG - Defense Infrastructure Grant"), "DIG - Defense Infrastructure Grant" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "DRG - Defense Reinvestment Grant"), "DRG - Defense Reinvestment Grant" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "DTF - Defense Task Force"), "DTF - Defense Task Force" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "FL Trade Grant"), "FL Trade Grant" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "Foreign International Offices"), "FSF Event Market Assistance" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "FSF Event Market Assistance"), "DIG - Defense Infrastructure Grant" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "FSF Major & Regional Grant Program"), "FSF Major & Regional Grant Program" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "General Services"), "General Services" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "Investment"), "Investment" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "Other Income"), "Other Income" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "PTE Grant"), "PTE Grant" + BR(), "")

All Answers

Alain CabonAlain Cabon
Hi Kathleen,

There are just extra commas ( "Brazil Market Entry Grant" , + BR(), null)  should be  "Brazil Market Entry Grant"  + BR(), "")
And an extra "+" at the end (useless).

Nothing serious, things will be better like below.
 
IF(INCLUDES(  Opportunity_Number__r.Grant_Opportunity_Type__c  , "Appropriation"), "Appropriation" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "Brazil Market Entry Grant"), "Brazil Market Entry Grant" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "DIG - Defense Infrastructure Grant"), "DIG - Defense Infrastructure Grant" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "DRG - Defense Reinvestment Grant"), "DRG - Defense Reinvestment Grant" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "DTF - Defense Task Force"), "DTF - Defense Task Force" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "FL Trade Grant"), "FL Trade Grant" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "Foreign International Offices"), "FSF Event Market Assistance" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "FSF Event Market Assistance"), "DIG - Defense Infrastructure Grant" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "FSF Major & Regional Grant Program"), "FSF Major & Regional Grant Program" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "General Services"), "General Services" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "Investment"), "Investment" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "Other Income"), "Other Income" + BR(), "") +
IF(INCLUDES( Opportunity_Number__r.Grant_Opportunity_Type__c  , "PTE Grant"), "PTE Grant" + BR(), "")
This was selected as the best answer
Kathleen Munetz-Vasquez 3Kathleen Munetz-Vasquez 3
Alain Cabon, 

Thank you so much for your reply! This worked! YAY!