Last active
August 29, 2015 14:06
-
-
Save arufian/736d8044cea691a34b9e to your computer and use it in GitHub Desktop.
Assigning List of Salesforce Object Value into SelectOption
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class OptionController { | |
public List<CustomObject__c> ListOfItems {get;set;} | |
public List<SelectOption> getItems() { | |
List<SelectOption> options = new List<SelectOption>(); | |
for(CustomObject__c sObj: ListOfItems) { | |
options.add(new SelectOption(sObj.Id, sObj.Name)); | |
} | |
return options; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment