9 件の回答
Hi Abhilash,If you want to display pick list values in your custom page through dyanamic apex .You can check below link it will help .https://developer.salesforce.com/blogs/developer-relations/2008/12/using-the-metadata-api-to-retrieve-picklist-values.htmlIf you want in a string array or list then you can use below code . public List<String> getPickListValuesIntoList(){
List<String> pickListValuesList= new List<String>();
Schema.DescribeFieldResult fieldResult = ObjectApiName.FieldApiName.getDescribe();
List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
for( Schema.PicklistEntry pickListVal : ple){
pickListValuesList.add(pickListVal.getLabel());
}
return pickListValuesList;
}
Let us know if it helps !!
ThanksManoj