Multipicklist Value
A Multipicklist value is the representation of a value of a Salesforce picklist field allowing multiple selections. It carries all the selected values, their labels, as well as the values and labels of all the other options the picklist offers.
The various methods available have to be utilized to make any of use of Multipicklist values, as the value as is should not be presented as text or used in Salesforce communication. Generally the getEntries()
and allEntries()
methods provide what is needed - either the selected options or all options as a Collection of Maps containing data of each option. Loop through the Collection and use either the value or label, or both, within each of the Maps.
Related commands
record, relatedList & query
These commands are the producers of Data items, in which Picklist values with multiple selections may appear in.
Methods
allEntries() | Resolves into a Collection containing Maps representing all of the entries, or options, of the picklist field this value is from. Each entry Map value contains the following keys and String values:
For example, if looping through the Collection accessed with |
allLabels() | Resolves into a Collection containing Strings that are the labels of all of the picklist entries. If the For example, the expression |
allValues() | Resolves into a Collection containing Strings that are the API values of all of the picklist entries. For example, the expression |
asList() | Resolves into a Collection of Strings containing the API values of the selected picklist values. If there are no selected values, the Collection will be empty. For example, the expression |
contains(String) | Resolves into a Boolean telling whether the given String parameter is one of the selected entries' API values. For example, the expression |
containsLabel(String) | Resolves into a Boolean telling whether the given String parameter is one of the selected entries' labels. For example, the expression |
getEntries() | Resolves into a Collection containing Maps representing the selected entries, or options, of the picklist field this value is from. Each entry Map value contains the following keys and String values:
For example, if looping through the Collection accessed with Using the shorthand form the expression becomes |
getLabels() | Resolves into a String that contains the labels of the selected picklist values, separated with commas. If the For example, the expression Using the shorthand form the expression becomes |
rawValue() | Resolves into a String that is the picklist field value as provided by the Salesforce API, which is all the selected entries' API values separated by semicolons. For example, the expression |