Created
January 7, 2021 23:27
-
-
Save lukethacoder/0550587d5f5d14a8620f5c3a014bc072 to your computer and use it in GitHub Desktop.
APEX: Get a list of picklist values (PicklistEntry) objects in Apex Salesforce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<PicklistEntry> fields = Account.SObjectType.getDescribe().fields.getMap().get('Type').getDescribe().getPicklistValues(); | |
for (PicklistEntry picklistEntry : fields) { | |
System.debug(picklistEntry.getLabel() + ' with value: ' + picklistEntry.getValue()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment