function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
tim111tim111 

custom picklist.???

I am new to apex....i want to create Custom Picklist in whick i want all the fields of lead....Please tell me the code what should i write...Help will really be appreciated...!!!

Best Answer chosen by Admin (Salesforce Developers) 
Ritesh AswaneyRitesh Aswaney

you will need to use a describe call to get hold of all the fields on the Lead object. im assuming this is for a visualforce page - in which case you just wrap the field name in an apex:selectList / selectOptions

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dynamic_describe_objects_understanding.htm

 

eg

Map<String, Schema.SObjectField> M = Schema.SObjectType.Account.fields.getMap();