3

I need to update a picklist field (contains list of month from January to December )value with a text field that holds correct month value. could you please help me with the correct syntax? thanks

1
  • 1
    I removed the salesforce-communities and salesforce-crm tags since your question doesn't have anything to do with either one. A tag is a keyword or label that categorizes your question with other, similar questions. Using the right tags makes it easier for others to find and answer your question. Commented Dec 26, 2013 at 16:18

2 Answers 2

4

You can set a Picklist value to a String inside a Trigger (doesn't even have to match the available values -- though you might want to validate it before setting).

Inside a before insert/update trigger you could do the following (assuming this is an Account):

for (Account a : Trigger.new)
{
  a.MonthPicklist = a.MonthText;
}
0

You cannot do this currently, but if you watch this dreamforce session, it sounds like it is coming in Spring '14. https://www.youtube.com/watch?v=Kyn81zd8TVE&t=51m55s (#safeharbor) Follow this group on the success community for more info on what is upcoming in Spring '14: https://success.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F9300000001okuCAA

You must log in to answer this question.