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.html
If you want in a string array or list then you can use below code .
https://developer.salesforce.com/blogs/developer-relations/2008/12/using-the-metadata-api-to-retrieve-picklist-values.html
If you want in a string array or list then you can use below code .
public ListgetPickListValuesIntoList(){ List pickListValuesList= new List (); Schema.DescribeFieldResult fieldResult = ObjectApiName.FieldApiName.getDescribe(); List ple = fieldResult.getPicklistValues(); for( Schema.PicklistEntry pickListVal : ple){ pickListValuesList.add(pickListVal.getLabel()); } return pickListValuesList; }
No comments:
Post a Comment