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
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.

.