3

I would like to mass update picklist values in a custom object from picklist values in a standard object.

In the absence of universal picklists, i am having to manage a few picklists in different objects. These picklists have hundreds of options and keeping them in-sync is proving to be a challenge.

Does anyone know of a way that i can update en-masse a picklist on one object from another picklist on a separate object? Either via using excel, data loader, or the api?

Thanks.

1

You could use the MetaData API to create the Picklist values. See Picklist.

Depending on your needs you could use the Declarative Metadata syntax with the Force.com Migration Tool.

1

You can also use the metadata API from apex. See here to learn how. I implemented a solution that updates a set of picklists from the contents of a custom object using this API. The code in this question gives you an example of how to update the picklists in Apex. Or you could use the metadata API from an external client (which is the more common use). In addition, you need to use the Schema.DescribeFieldResult class to pull the values out of your master picklist (getPicklistValues() instance method will get you the list of values). Note that it's only updating the picklist values and won't change the values stored with any existing records.

  • I'd be VERY interested to learn more about your solution.. – Tony H. Jan 21 '14 at 3:50
  • 1
    @AntonioHerrera I posted some of the code in this question – donmac23 Jan 21 '14 at 21:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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