Created
November 23, 2018 10:52
-
-
Save SalesforceBobLightning/ba655cfe6a3319b6492017aa6d5fe352 to your computer and use it in GitHub Desktop.
Get Salesforce PickList values as CSV String
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
Schema.DescribeFieldResult dfr = Opportunity.StageName.getDescribe(); | |
List<Schema.PicklistEntry> picklistValues = dfr.getPicklistValues(); | |
String output = ''; | |
for(Schema.PicklistEntry entry : picklistValues) { | |
if (output != '') { | |
output += ','; | |
} | |
output += entry.getLabel(); | |
} | |
System.debug(output); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment