Skip to main content

Posts

Showing posts with the label Getting picklist value dynamically

How to get Picklist Value of an object Dynamically

This is very simple. I am sharing some code ,please go through this Here is My Controller  public class testclass {     public Job__c job{get;set;}     public List<SelectOption> options{get;set;}     public testclass(){         options = new List<SelectOption>();         Schema.DescribeFieldResult fieldResult = Job__c.Status__c.getDescribe();         List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();         for( Schema.PicklistEntry f : ple){                   options.add(new SelectOption(f.getLabel(), f.getValue()));         }     }         } My Page  <apex:page controller="testclass ">   <apex:form>       <apex:pageBlock>              ...