+ Start a Discussion
Alok_NagarroAlok_Nagarro 

Access the picklist valus !!!!!

Hi,

I m trying to get all the values of a picklist (custom field) using apex, but still i couldn't.

Is there any way to do it ?

If you have, pls reply......

 

 

Thanks.

Best Answer chosen by Admin (Salesforce Developers) 
rscottrscott

All Answers

rscottrscott
This was selected as the best answer
aalbertaalbert

You can retrieve picklist values in Apex. Use the Describe methods, specifically on the Field you want to access the picklist values.

 

Here is sample code:

 

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

 

 

 

Alok_NagarroAlok_Nagarro

Hi,

 

Thanks to both of you......

It's working.

.