Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I would like to update a picklist field value with another picklist field value in the workflow action 'Fieldupdate'. Is it possible?

share|improve this question

4 Answers 4

up vote 5 down vote accepted

**The Question has been refined and the original is no longer a correct solution.

The original answer is for setting the value of a Text Field.

Setting the value of a Picklist via an Apex Trigger:

Unfortunately it is not possible to set the value of a Picklist using a Field Update. Instead you can use an Apex Trigger. This guide from Salesforce should start you sown the right path: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_qs_trigger.htm

This is a quick example:

Field1__c - This is used to represent any criteria you might use to set when the field update should happen

Field2__c - This is your picklist

Field3__c - This is the field that contains the value you want to use to set the picklist value

trigger MyTrigger on Case (before insert, before update) {
        for(Case cs : Trigger.new){

            if(cs.Field1__c == true){ //Put your criteria here to set when this happens
                cs.Field2__c = cs.Field3__c;
            }

        }
}

(Original Answer) Setting the value of a Text Field:

It is possible to set the Field to the value of another Field in the Record by using the Formula Editor.

In the 'Specify New Field Value' section when adding a new Field Update you can select 'Use a formula to set the new value'

This will show a text box beneath that you can enter a formula in such as: TODAY() + 3 or {!Case.Id}

If you need help you can click on 'Show Formula Editor'. Above the large text box is an 'Insert Field' button. This will allow you to select the field that you wish to take the value from.

share|improve this answer
    
But this is not a text field. It is a picklist field. It does not show formula editor. –  Ashok Aug 20 '12 at 17:24
    
If it is a picklist field then unfortunately you cant do what you need with a workflow, you will need to use an Apex Trigger –  Jon Hazan Aug 20 '12 at 17:26

It depends on which way you're going...

From Picklist to Text --- Yes (formula text(PicklistField__c) ) From Text to Picklist --- No From Picklist to Picklist -- No

Whenever the field being updated is a picklist you can only select a specific value in that picklist, or a relative value (Above or below current selection).

To go from Text -> Picklist or Picklist -> Picklist you need to use a trigger.

What are you trying to do? What's your use case for having two fields on the same record with the same value? Instead of using a field update can you use a formula field that displays the value of the picklist?

share|improve this answer
1  
It is a different scenario. Picklist to Picklist. It seems that formula option is not available in this scenario. I need to go to Apex triggers. –  Ashok Aug 20 '12 at 17:43
    
That's right, Picklist to Picklist requires apex –  Salesforce Wizard Aug 20 '12 at 17:50

Yes, it is. When you are creating the Field Update, select "Use a formula to set the new value." You can then choose any value to assign to your field.

share|improve this answer
    
But this is not a text field. It is a picklist field. It does not show formula editor. –  Ashok Aug 20 '12 at 17:23

Not sure what your requirements are, but could this be done using field dependencies instead of workflow rules? Set up your 'parent' picklist to only allow a certain 'child' picklist value to be selected. Might not work if you arent using standard page layouts or dont have both fields visible on the same page layout, but worth a shot otherwise.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.