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
udaykalyank1.3923045490576467E12udaykalyank1.3923045490576467E12 

custom settings into an existing multi select picklist in visualforce

Hi All,

How to add list custom settings into an existing multi select picklist in visualforce?

VF Page

<apex:selectList value="{!selectedValue}" size="1" multiselect="false">
                                 <apex:selectOptions value="{!MyOptions}"/>
  </apex:selectList>

Apex:

public List<SelectOption> getMyOptions(){
    List<SelectOption> options = new List<SelectOption>();     

    // Reading picklist values and labels
    Schema.DescribeFieldResult fieldResult = Investor_Profile__c.Investor_Groups__c.getDescribe();
    List<Schema.PicklistEntry> picklistEntries = fieldResult.getPicklistValues();

    // Adding apicklist values to the select list
    for(Schema.PicklistEntry entry : picklistEntries){
        options.add(new SelectOption(entry.getValue(), entry.getLabel()));
    }
    // Now adding custom settings to the select list
     for(Investor_Details__c setting : Investor_Details__c.getAll().values()){
        options.add(new SelectOption(setting.name, setting.name));
            }    
      
       return options;
}



with this code am getting the picklist values but i need to get the multi select picklist values.
Reply ASAP....
Thanks in Advance....:)

NishBNishB
Hi,
     Set the multiselect attribute in <apex:selectList> to true to select more than one value set the size accordingly