Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
You can do this using the describe functionality. Here's an example for the opportunity stage picklist:
Schema.DescribeFieldResult fieldResult = Opportunity.StageName.getDescribe(); List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues(); List<SelectOption> opts=new List<SelectOption>(); for( Schema.PicklistEntry p: ple ) { SelectOption option=new SelectOption(ple.getValue(), ple.getLabel()); opts.add(option); }
You can do this using the describe functionality. Here's an example for the opportunity stage picklist: