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

Formula Code...Help...

I created a formula field that is to display a value from a picklist field from another object based on a look up of a user. I wrote this formula, but it is not displaying the correct value from the picklist. Can anyone recommend how to fix it?
Thanks in advance,
CASE(Sales_Rep__r.Team__c , "Advertising Operations", "Business Services",
"Communities", "Communities-Central", "Communities-East", "Communities-North Coastal", "Communities-North Inland", "Communities-South", "Consumer Marketing",
"Database Marketing", "Enlace", "Executive", "Lifestyles & Entertainment",
"Majors & Nationals", "Majors-Digital Media", "Marketplace", "Marketplace-Automotive",
"Marketplace-Digital Media", "Marketplace-Real Estate", "Marketplace-Recruitment", "Niche", "Online Customer Service", "TLN", "Training", "U-T Direct Marketing" )
Nathan CrosbyNathan Crosby
You'll need a value/return pair in your case statement for each value. Try:

CASE(Sales_Rep__r.Team__c , 
"Advertising Operations", "Advertising Operations", 
"Business Services","Business Services",
"Communities", "Communities", 
"Communities-Central", "Communities-Central", 
"Communities-East", "Communities-East", 
"Communities-North Coastal", "Communities-North Coastal", 
"Communities-North Inland", "Communities-North Inland", 
"Communities-South", "Communities-South", 
"Consumer Marketing", "Consumer Marketing",
"Database Marketing", "Database Marketing", 
"Enlace", "Enlace", 
"Executive", "Executive", 
"Lifestyles & Entertainment", "Lifestyles & Entertainment",
"Majors & Nationals", "Majors & Nationals", 
"Majors-Digital Media", "Majors-Digital Media", 
"Marketplace", "Marketplace", 
"Marketplace-Automotive", "Marketplace-Automotive",
"Marketplace-Digital Media", "Marketplace-Digital Media", 
"Marketplace-Real Estate", "Marketplace-Real Estate", 
"Marketplace-Recruitment", "Marketplace-Recruitment", 
"Niche", "Niche", 
"Online Customer Service", "Online Customer Service", 
"TLN", "TLN", 
"Training", "Training", 
"U-T Direct Marketing", "U-T Direct Marketing",


Message Edited by Nathan Crosby on 11-20-2008 10:44 AM

Wow, that worked...For some reason...the code looks like it is just duplicating the value twice. Is it meaning that if it equals this, then return that?



Nathan CrosbyNathan Crosby
Exactly. The last argument is returned if no match is found. So if you add a new value to the picklist the formula will return "Unknown" until this value/return pair is added to the formula.
Why would you make that big case statement duplicating all the values when all you really need to emit is


?  Is it that you only want this formula field to be defined in certain cases?