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
RavishankarRavishankar 

Add all User as element in a Picklist

Can any one tell me how can i add all user in a multi select  picklist.

 Can any one help me how can i do it.

 

I hope any one help me.

 

 

Pradeep_NavatarPradeep_Navatar

There is only one way to add the values to multi-select picklist, that is you have to hardcode these values at the time when you create / edit the field. This can not be done as required by you.

 

Hope this helps.

RavishankarRavishankar

I am not limited to use picklist.  Basically I have created one object with 2 fileds "Class Name", "Institute Type" and added this content in Tab. Now when user creates new entry for this he can insert Class Name and Institute Type, After this I want to give the option to user to select one or more users of the application and send them an email. I know how to send email and I am also aware how to fetch the list of all users. Only thing I want to know is as soon as user creates the entry "Class Name" and "Institute Type" then a picklist (or any object) should be shown that should contain list of all the users of this application and user should be able to select multiple names from there and an email should be sent to all of them.

 

Let me know if the question is not clear.

GomsueyGomsuey
Hi, I hope you need to show all the users in a multiselect picklists. This code may help !!! VF PAGE: CONTROLLER : public class cntrlrAllUsrdropdwn { List lstUser = new List(); //Contructor public cntrlrAllUsrdropdwn() { lstUser = [Select id,name from User]; } public List getItems() { List options = new List(); for(integer i=0;i lstSelUsers = new List(); public void setSelUsers(List lstUsers) { this.lstSelUsers = lstSelUsers; } public List getSelUsers() { return lstSelUsers; } }
GomsueyGomsuey

I donno wats happening with VF page

 

This is in Text

 

 

apex:selectList value={!SelUsers} size=3 multiselect=true-----
       

apex:selectOptions value={!Items}-----

/apex:selectOptions-----

/apex:selectList

 

I hope this is helpful !!