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
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...