+ 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