+ Start a Discussion
UmapenUmapen 

picklist value from query results

Is it possible to create picklist value based on query results.

Maximum values returned can be 15.

 

example: providing citylist base on state selected. and only those city name where the shows are being scheduled.

ShikibuShikibu

It sure is. Try something like this:

 

 

public SelectOption[] results {get; set;} results = new List<SelectOption>(); for(sObject obj : [SELECT ...]) { results.add( new SelectOption((String)obj.get('Id'), (String)obj.get('Name'))); } }