I want to add values to my picklist on the basis of a text field

I am having a text field and a picklist field.I want that picklist options be updated everytime a new & unique value is filled in the text field.So ,the next time user wishes to create a new record,he has that option available to be selected.How can this be achieved?


As AslamK mentions in his comment, you can modify the picklist entries from Apex. However, this is a web service call, and (I assume) requires permissions that typical users won't have. (Also, unless you cut it down the amount of Apex code you are adding is very large.)

An alternative is to merge the picklist values you get from a getPicklistValues describe call for the field with the added values obtained using a group by aggregate query on the field. Use a set to remove duplicates and then turn that set into a list and sort to have the values in a defined order. You return the values from your controller as a list of SelectOption objects and present them via the apex:selectOptions tag.

Also check that "Strictly enforce picklist values" is not selected for the picklist field.

Category: picklist Time: 2016-07-29 Views: 0
Tags: picklist

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.246 (s). 12 q(s)