Global Picklists: Define Globally, Use Locally

image

Imagine you have to store information about t-shirt sizes on multiple entities: Accounts, Users, Custom Objects, etc. And tomorrow, your company decides to switch to a different size format, for example using 48, 50, 52 instead of small, medium and large. You wouldn’t have any other option but to go to each and every field and update the picklist values there. And if you forget to update some of the field values, or if you have a typo like “Medim” instead of “Medium,” you will end up with broken reports and potentially other issues as well.

Global picklists will solve this problem for you and this feature is available right out of the box in the Winter ‘17 release. Let’s look at how you can create picklist value set and use it across multiple fields in your Salesforce instance today.

Creating a New Picklist Value Set

Say you want a picklist value set to store T-Shirt sizes and then use it on custom fields on Accounts and Contacts in your Salesforce instance. You can find the Picklist Value Sets section under Create in Classic UI, or under Objects and Fields in Lightning UI.

Simply click new and fill all of the required fields. On the example below you can see the global value set I created for T-Shirt sizes in my org.

image

Have you noticed something there? You can actually see the list of fields, where this particular picklist value set has been used. This makes it easy to keep track of all of the places where you used that value set.

Using Global Value Sets on Custom Fields

Now, after we create a picklist value set, we can use it when creating custom fields (both picklists and multi-select picklist field types are supported, it also works with dependent picklists) on the objects you like. The process of field creation didn’t change much, the main difference is in the screenshot below.

image

As you can see, you now have a chance to select if you want to use a global value set or specify values on a field level (as you used to do it before). Isn’t it simple?

Interacting with Global Picklists via Metadata API

With the Metadata API, you can interact with both global values sets and fields that are using it. The example below illustrates how global value sets are represented in the Metadata API.

Updated:This is a basic global value set.TerritoriesNorthtrueSouthEastWesttrue

Please note, that Metadata API representation for global value sets was changed in API version 38.0. You might want to review the changes in the links in the resources section of this post.

When to use Global Value Sets

You should consider using global value sets for your picklist fields if:

  • you need reusable picklist values on different fields and/or objects
  • you will have 500 or fewer picklist values

Note: we’re considering increasing this limit in a future release.

When shouldn’t you use Global Value Sets

Some use cases where you won’t want to use Global Value Sets include:

  • If you know that global value set will not be used by more than one field
  • If you need to have more than 500 picklist values
  • If you don’t want your fields validated when inserting via API

Resources

About the Author

Vladimir is a former engineer from the team that delivered Global Picklists. He has recently switched to product management and planning to use his deep technical expertise to make life easier for Salesforce admins and developers.

Also found at : Global Picklists: Define Globally, Use Locally

Post author

Dustin Gurley is an Designer, Developer, Artist, Instructor, Critical Theorist and Systems Engineer. He has an extensive background working professionally with 2D/2.5D/3D Motion Graphics, Compositing, Film, Video, Photography and client-side performance techniques as it pertains to web development. Dustin recently completed work on his Master of Fine Art degree in Motion Media Design (Motion Graphics) from the Savannah College of Art and Design. Prior to beginning his graduate work, Dustin obtained a Bachelor of Art degree in Communication Studies with a concentration in Broadcast and Emerging Media from the University of North Carolina at Wilmington. In addition to design and modeling, Dustin enjoys toying with his view camera, working with scratch film, authoring media related material and contributing to various industry conferences. When not in front of a computer, Dustin can be found with his wife, Regina Everett Gurley. The couple enjoys dividing their time between their home just outside of Raleigh, North Carolina and the beautiful North Carolina coast. Currently, Dustin serves as the Lead Instructor of Internet Technologies for Wake Technical Community College in Raleigh, North Carolina.