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
TGHTGH 

Formula to Update Text Field to Picklist Selection

Hi,

 

We have a custom object hooked up to the Account object called "Environment." It basically tells our users what our customers current software environment is. We have a lookup field on our Cases that points to the Environment in question for a particular Case.

 

The problem is that whenever we update our Environment, the lookup is going to point to that Environment as it currently exists, not as it existed at the time of the Case.

 

To fix this, I'm trying to create a workflow rule that updates a text field on the Case object to display what the Environment's "Release #" is at the time of the Case. It's just a static field and we don't want it to change.

 

So I've set up a workflow rule for Cases with the criteria:

ISCHANGED(Environment__c)

(Where "Environment__c" is the lookup field on the Case.)

 

So when the "Environment__c" is chosen, it should update a standard text field "Static Release #" on the Case object to display what the "Release #" is on the Environment case.

 

What I'm trying to do with the field update workflow:

"Static Release #" = "Environment__r.Release#__c"

 

Of course, if I try to do that it tells me I need to pick a CASE() or ISPICKVAL() formula, and neither of those look remotely helpful.

 

Am I doing something wrong or is this beyond the realms of SFDC?

Message Edited by TGH on 02-26-2009 11:05 AM
lee_carter73lee_carter73
so if i understand this correctly you are wanting a field update that updates a text field with the value of a lookup field?
TGHTGH

Actually, what I want is to have the field updated to the value of the picklist field on the custom object whenever someone enters a value through the lookup field.

 

1 - User picks a record from the lookup field.

2 - Salesforce updates the text field with the value of a picklist field on the record selected.

 

I've tested it a million times and SF tells me there's no syntax error, but something has to be wrong. Either that or I need a trigger, and I'm the worst programmer in existence.

lee_carter73lee_carter73

this is probably going to be a pain depending on how big your picklist is but try a case statement

CASE((Picklist field), Value1, "Value1", Value2, "Value2")

 

so on for all your values in the picklist

TGHTGH

Thanks!

Yes, it will be a pain, but if it works then it's definitely worth it.

Thanks again!

TGHTGH
Not the most elegant formula in the world, but it works like a charm! Thanks!
lee_carter73lee_carter73
yeah that is currently the only work around vote for this idea to get a better solution put in place http://ideas.salesforce.com/article/show/43022/The_ability_to_use_a_picklist_value_in_a_formula_field_without_ISPICKVAL