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
sekharasekhara 

Multiselect picklist

Hi ,

 

I am trying to search using Multi select picklist but my code is working for only picklist.

 

Code:

public List<String> technologies {
get {
if (technologies == null) {

technologies = new List<String>();
Schema.DescribeFieldResult field = Contact.test__c.getDescribe();

for (Schema.PicklistEntry f : field.getPicklistValues())
technologies.add(f.getLabel());

}
return technologies;
}
set;
}

 

Can any one convert this code to Multi select picklist.

 

Thanks in advance.

crop1645crop1645

sekhara:

 

Your code is correct in returning a list of picklist values; I tried it on my own multi-select picklist

 

However, you mentioned searching ..the Apex field value for a multiselect field appears as 'xxx;yyy;zzz' if xxx, yyy, and zzz were selected by the user for the SObject in question.  You didn't say whether you were doing SOQL seraches or just APEX code searches

 

For SOQL, refer to: http://boards.developerforce.com/t5/Apex-Code-Development/How-to-retrieve-multi-select-picklists-using-includes-excludes/td-p/172210