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
RAAMRAAM 

Need help adding values to a Picklist dynamically

I have a Picklist called Status in my junction object visualforce page, it contains three values. I need to display to the values in another visualforce page in a table and i also need to add additional values to the picklist, how do i do it plz help me...
Drew1815Drew1815
Check out a great blog post by Quinton Wall on how to use Dynamic Apex to get picklist values and display in a VF page:
http://blog.sforce.com/sforce/2008/12/using-the-metadata-api-to-retrieve-picklist-values.html

In terms of adding new picklist values, that is usually only a System Admin function. You can automate that process using the metadata api, but I am not aware of anyway to do that with Apex.
Metadata api documentation: http://www.salesforce.com/us/developer/docs/api_meta/index.htm

-Andrew


RickyGRickyG
RAAM -

Chapter 12 in the Developer Guide uses an example that replicates the functionality of picklists (dependent picklists, no less) in Visualforce.  The example includes giving a user the ability to add values to a picklist using a data entry field.

Hope this helps.
hamshuhamshu

Hi Ram,

 

 

Just follow this link this will be helpfull
  http://www.forcetree.com/2009/06/dynamically-add-values-to-picklist.html

 

 

 

Thanks,

jaba