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

Populate the Picklist

I need to populate a picklist with all the users under a particular profile.


Need Help.


You can do it something like this:



public List<SelectOption> getUserList () { List<SelectOption> result = new List<SelectOption>(); for (User iter : [select id, name from User where .....<your profile conditions here>...]) { result.add(new SelectOption(,; } return result; } <apex:selectList multiselect="false" size="1" value="{!userId}"> <apex:selectOptions value="{!userList}" /> </apex:selectList>