+ Start a Discussion
test269test269 

Dynamically inserting values to standandard picklist field using apex coding

Hi,

  I want to insert values to leadsource(standard picklist field) in contact object dynamically using apex coding.

 

Any one can u please help me.

 

Thanks in advance.

Nagalaxmi

Cloud CredenceCloud Credence

Hi,

 

Please search for DescribeSObject or Schema.DescribeFieldResult to start with. 

 

Schema.DescribeFieldResult F = Account.Industry.getDescribe();
List<Schema.PicklistEntry> P = F.getPicklistValues();

 

Thanks

ShahTheTrainerShahTheTrainer

Do you want

    1.  to bind automatically all the field values i.e. web, phone E/nq etc to the Visual Force page for "Search" purpoe

                              (or)

     2. adding another value to the existing PickList Values

test269test269
Hi , i want to adding another value to existing picklist values.
test269test269

Hi,

 

 Thank you for your replay.Here  i want to adding another value to the Existing picklist values.

 

For example in opportunity object stage name fields values are added like this to existing values test1,test2,...etc...