Multipicklist Value
A Multipicklist value is the representation of a value of a Salesforce pick-list 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 pick-list offers.
The various methods available have to be utilized to make any of use of Multipicklist values, as the value as it 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 Pick-list values with multiple selections may appear in.
Methods
allEntries() | Resolves into a Collection containing Maps representing all the entries, or options, of the pick-list 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 thepick-list pick-list entries. If the For example, the expression |
allValues() | Resolves into a Collection containing Strings that are the API values of all the pick-list entries. For example, the expression |
asList() | Resolves into a Collection of Strings containing the API values of the selected pick-list 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 pick-list 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 pick-list 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 pick-list field value as provided by the Salesforce API, which is all the selected entries' API values separated by semicolons. For example, the expression |