I am trying to get unique items from an object so I am starting with a set however I need the values to be returned as a list for the visualforce <apex:selectOptions>
component. I have tried the code below, and variations, but I keep getting errors related to the type not being set correctly. Can anyone help me out? Is there a better way of populating a list with unique values from a SOQL query?
public List<SelectOption> getItems() {
Set<License__c> license = new Set<License__c>( [SELECT Name FROM License__c] );
List<SelectOption> options = new List<SelectOption>();
options.addAll(license);
return options;
}