1

Is there a way to have a multi picklist with user's names as the values? (Theoretically, this should automatically update if there is a new user)

2

Normally I would vote to close this as off topic, considering you have shown zero attempt to research this problem or solve it yourself. However, in this case there is an extremely simple option out there.

Our very own @metadaddy put together a package that does just what you want: Multiselect Picklist Visualforce Component. Here's a simple demo:

Page

<apex:page controller="DemoController">
    <c:MultiselectPicklist leftLabel="Available Users"
        leftOptions="{!allUsers}"
        rightLabel="Selected Users"
        rightOptions="{!selectedUsers}"
        size="14"
        width="150px"/>
</apex:page>

Controller

public with sharing class DemoController
{
    public List<SelectOption> allUsers { get; set; }
    public List<SelectOption> selectedUsers { get; set; }
    public DemoController()
    {
        allUsers = new List<SelectOption>();
        selectedUsers = new List<SelectOption>();
        for (User user : [SELECT Name FROM User ORDER BY Name])
            allUsers.add(new SelectOption(user.Id, user.Name));
    }
}
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.