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
KNKKNK 

Need Help on controller

Hi Team,

 

i want to write a control to retreive 3 user record which need to display in vf page . suppose these are the names say Vinay, Kumar and Ganesh. How can retrieve these users to vf page.

 

any guidance will be appreciated here.

Fan@EXCFan@EXC

String[] targetNames = new String[]{'Vinay', 'Kumar', 'Ganesh'};
List<User> myList = [Select Id, Name FROM User WHERE Name in :targetNames];
for(User u : myList){
System.debug(u.Id + '----' + u.Name);
}

 

You can easily expose the list to VF page.

sushant sussushant sus
create three list<user>with get set property

List<User> myList = [Select Id, Name FROM User WHERE Name='vinay'];
then uae on page