function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sgottreusgottreu 

Use Apex to pull values from a picklist

My client wants to have a quote with items sub-divided by product family.  How would I access the values in the ProductFamily picklist using Apex?  The questions I have seen on this were before the Summer '09 release.  Has anything been updated?
Best Answer chosen by Admin (Salesforce Developers) 
Kirtesh_JainKirtesh_Jain

Hi

 

 

The solution to this one is listed in the documentation as:

 

Schema.DescribeFieldResult F = Account.Industry.getDescribe();

List P = F.getPicklistValues(); Each picklistEntry then has getLabel and getValue methods.

 

 

 

thanks

Kirtesh

All Answers

wesnoltewesnolte

Hey

 

The solution to this one is listed in the documentation as:

 

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

 Each picklistEntry then has getLabel and getValue methods.

 

Cheers,

Wes

Kirtesh_JainKirtesh_Jain

Hi

 

 

The solution to this one is listed in the documentation as:

 

Schema.DescribeFieldResult F = Account.Industry.getDescribe();

List P = F.getPicklistValues(); Each picklistEntry then has getLabel and getValue methods.

 

 

 

thanks

Kirtesh

This was selected as the best answer