PicklistEntry Class

Represents a picklist entry.

Namespace

Schema

Usage

Picklist fields contain a list of one or more items from which a user chooses a single item. They display as drop-down lists in the Salesforce user interface. One of the items can be configured as the default item.

A Schema.PicklistEntry object is returned from the field describe result using the getPicklistValues method. For example:

Schema.DescribeFieldResult F = Account.Industry.getDescribe();
List<Schema.PicklistEntry> P = F.getPicklistValues();

PicklistEntry Methods

The following are methods for PicklistEntry. All are instance methods.

getLabel()

Returns the display name of this item in the picklist.

Signature

public String getLabel()

Return Value

Type: String

getValue()

Returns the value of this item in the picklist.

Signature

public String getValue()

Return Value

Type: String

isActive()

Returns true if this item must be displayed in the drop-down list for the picklist field in the user interface, false otherwise.

Signature

public Boolean isActive()

Return Value

Type: Boolean

isDefaultValue()

Returns true if this item is the default value for the picklist, false otherwise. Only one item in a picklist can be designated as the default.

Signature

public Boolean isDefaultValue()

Return Value

Type: Boolean