GlobalPicklist
Represents a global picklist, or the set of shared
picklist values that custom picklist fields can use. In contrast, the custom picklist fields
that are based on a global picklist are of type CustomValue. This type extends the Metadata metadata type and inherits its
fullName field.
File Suffix and Directory Location
GlobalPicklist components have the suffix .globalPicklist and are stored in the globalPicklist folder.
Version
GlobalPicklist components are available in API version 37.0 only. In API version 38.0 and later, GlobalPicklist is replaced by the GlobalValueSet type.
Fields
Field Name | Field Type | Description |
---|---|---|
description | string | It’s useful to state the global picklist’s purpose, and which objects it’s intended for. Limit: 255 characters. |
globalPicklistValues | GlobalPicklistValue[] | Requires at least one value. The list of values, or “picklist value set,” that’s defined for a global picklist. The picklist value set is inherited by any custom picklist field that’s based on that global picklist. Each value is of type GlobalPicklistValue. A global picklist can have up to 1,000 total values, including inactive values. |
masterLabel | string | Required. A global picklist’s name, which is defined when the global picklist is created. Appears as Label in the user interface. |
sorted | string | Indicates whether a global picklist’s value set is sorted in alphabetical order. By default this value is false. |
Declarative Metadata Sample Definition
This Territories.globalPicklist is an example of a GlobalPicklist component.
<?xml version="1.0" encoding="UTF-8"?>
<GlobalPicklist xmlns="http://soap.sforce.com/2006/04/metadata">
<description>Updated:This is a basic global picklist</description>
<globalPicklistValues>
<fullName>Northwest</fullName>
<default>false</default>
</globalPicklistValues>
<globalPicklistValues>
<fullName>Northeast</fullName>
<default>false</default>
</globalPicklistValues>
<globalPicklistValues>
<fullName>South</fullName>
<default>true</default>
</globalPicklistValues>
<globalPicklistValues>
<fullName>Southwest</fullName>
<default>false</default>
<isActive>false</isActive>
</globalPicklistValues>
<masterLabel>Territories</masterLabel>
<sorted>true</sorted>
</GlobalPicklist>
This example package.xml references the previous definition.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Territories</members>
<name>GlobalPicklist</name>
</types>
<version>37.0</version>
</Package>