Newer Version Available

This content describes an older version of this product. View Latest

GlobalValueSet

Represents the metadata for a global picklist value set, which is the set of shared values that custom picklist fields can use. A global value set isn't a field itself. (In contrast, the custom picklist fields that are based on a global picklist are of type ValueSet.) This type extends the Metadata metadata type and inherits its fullName field.

File Suffix and Directory Location

GlobalValueSet components have the suffix .globalValueSet and are stored in the globalValueSets folder.

Version

GlobalValueSet components are available in API version 38.0 and later. In API version 37.0, this is the GlobalPicklist type.

Fields

Field Name Field Type Description
customValue CustomValue[] Requires at least one value. The list of values (or “global value set”) that’s defined for a global picklist. The global value set is inherited by any custom picklist field that uses that value set. Each value is of type customValue. A global value set can have up to 1,000 total values (inclusive of inactive values).
description string It’s useful to state the global value set’s purpose, and which objects it’s intended for. Limit: 255 characters.
masterLabel string Required. A global value set’s name, which is defined when the global value set is created. Appears as Label in the user interface.
sorted boolean Required. Indicates whether a global value set is sorted in alphabetical order. By default this value is false.

Declarative Metadata Sample Definition

The following UpsellGlobal.globalValueSet is an example of a GlobalValueSet component.

1<?xml version="1.0" encoding="UTF-8"?>
2<GlobalValueSet xmlns="http://soap.sforce.com/2006/04/metadata">
3   <description>Updated:This is a basic global value set.</description>
4   <masterLabel>UpsellGlobal</masterLabel>
5   <customValue>
6      <fullName>Maybe</fullName>
7      <default>false</default>
8      <label>Maybe</label>
9   </customValue>
10   <customValue>
11      <fullName>No</fullName>
12      <default>false</default>
13      <label>No</label>
14   </customValue>
15   <customValue>
16      <fullName>Yes</fullName>
17      <default>false</default>
18      <label>Yes</label>
19   </customValue>
20   <sorted>false</sorted>
21</GlobalValueSet>
22

The following is an example package.xml that references the previous definition.

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <members>UpsellGlobal</members>
5        <name>GlobalValueSet</name>
6    </types>
7    <version>40.0</version>
8</Package>