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
apexnewbieapexnewbie 

Formula for picklist values

I have a picklist field called Primary_Complaint_Code__c which includes about 200 values. If there is any value in this field, I would like to transfer that value to a new text field called All_Complaint_Codes__c. I'm hoping there is a way to specify all value rather than adding a line for each of the 200 values. I also have 2 other fields Secondary_Complaint_Code__c and Third_Complaint_Code__c with the same values and I need a field that holds all values for all Codes for reporting purposes. 

 

IF(ISPICKVAL( Primary_Complaint_Code__c ,"Smart Meters"),"Smart Meters;", null)

 

My report would be:

All_Complaint_Codes__c contain "Smart Meters" rather than having Primary_Complaint_Code = Smart Meters  or Secondary_Complaint_Code__c = Smart Meters or Third_Complaint_Code__c = Smart Meters.

 

 

Best Answer chosen by Admin (Salesforce Developers) 
phiberoptikphiberoptik

Just to clarify, You are using a workflow rule with a field update that populates  All_Complaint_Codes__c with the value selected in the Primary_Complaint_Code__c field correct?

 

Just use the formula: TEXT(Primary_Complaint_Code__c)

 

 

All Answers

phiberoptikphiberoptik

Just to clarify, You are using a workflow rule with a field update that populates  All_Complaint_Codes__c with the value selected in the Primary_Complaint_Code__c field correct?

 

Just use the formula: TEXT(Primary_Complaint_Code__c)

 

 

This was selected as the best answer
apexnewbieapexnewbie

That is what I needed!!! Thank you!

 

TEXT(Primary_Complaint_Code__c) + "; " + 
TEXT( Secondary_Complaint_Code__c ) + "; " + 
TEXT( Third_Complaint_Code__c )

phiberoptikphiberoptik

Glad I could help!