+ Start a Discussion

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

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



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.

Hi Ram,



Just follow this link this will be helpfull