0

Good afternoon

I am hoping someone can help. I have spent the last couple of hour’s researching the different possibilities and I am none the wiser

Aim – If a value is added to the following field “Mailing Recipient” on either the lead object or contact object it updates the picklist in the other object

I would also like to mention I'm not a developer so I haven’t attempted any triggers or batch however I do grasps the basics of reading code.

Object : Contact Field : Mailing Recipient Api name : Mailing_Recipients__c Data type : Picklist (Multi-Select)

Object : Lead Field : Mailing Recipient Api name : Mailing_Recipients__c Data type : Picklist (Multi-Select)

Really looking forward to your help and guidance

Many thanks Mason

1
  • 1
    Why on earth would you want to change the picklist values in another object? Are you really asking whether you can update a picklist FIELD in another object? Because that's simple ...
    – user735
    Jan 22, 2015 at 17:28

3 Answers 3

1

It is definitely possible to write a picklist sync tool using the Metadata Api via Apex (as I have done that for one org). You'll need to use this package (free) that provides an apex wrapper to the metadata api.

This is a non-trivial effort as you'll need to write error checks on duplicates, max value length, max number of entries. You'll also need to know where to insert the new entry and support deletions. Test coverage requires clever mocking of the metadata API results as in PROD code, this is done via an http callout.

That said, custom metadata types, a new feature being introduced by Salesforce is the real answer to this. You can see this here . I believe this is in Pilot now

1
  • Custom Metadata Types are GA as of Summer 2015. May 24, 2015 at 18:01
0

As far as I know, you can't add Picklist values using Apex. This would mean that there's no possible Apex solution to your problem either.

The only answer I can give you is that the idea of Universal Picklists is listed on IdeaExchange. Apparantly Salesforce's Product Management team is looking into it since last month: https://success.salesforce.com/ideaView?id=08730000000BrfBAAS

4
  • HI Koen I read that post earlier. I have already emailed kirstie to see when this will become available. i think this can only be done via the meta data.
    – Masond3
    Jan 22, 2015 at 12:29
  • @Masond3 Technically it's probably possible to write a desktop tool that does perform this task using the meta data. It won't be a solution that's part of the Salesforce Platform though, and may be quite hard to develop. Please let us know what Kirstie answers to your mail! Jan 22, 2015 at 12:54
  • 1
    i have also found the following link phired.co.uk/salesforce/universal-picklist-1.php Which looks pretty good, but its suggesting to put your values within an object
    – Masond3
    Jan 22, 2015 at 12:56
  • 1
    There's a sign of hope on global picklists in the next release! Jul 20, 2015 at 22:02
0

Probably not the best answer, but consider a lookup or a custom settings instead of the pick list. Will solve ur problem, but may not be as efficient. Plz advice.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .