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.

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

Important

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 component 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, including 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

This 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

This example package.xml 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>

Any global value set created in API version 57.0 or later automatically has the __gvs suffix appended to the developer name. When you make any CRUD-based call with the GlobalValueSet type, you must append the suffix to the fullName field when you reference the type.

Wildcard Support in the Manifest File

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.