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
SuzsfdcSuzsfdc 

Need help with a Case Statement

I need to create a case statement that translates to picklist values to actual numbers. I have already tried to look at the tip sheets under the help and training section. Also submitted a case but SFDC can not help with formulas over the phone....
JakesterJakester
Show the code you've come up with so far, provide the error message you're getting, and tell us the end goal of the code.
JyotishaJyotisha
Hi,

I am not sure if I understood your question correctly but based on my understanding you need to update a field on the basis of another picklist field. for example: You have a picklist field "Primary" with values "Yes" and No" and now you want a formula field say "Primary No." which gets updated to 1 if user selects "Yes" and to 2 if user selects "No". If I am right then here is the formula:

Primary No. = CASE( Primary__c , "Yes", 1, "No", 2, 0)

Thanks,