+ Start a Discussion
Balakumar Ramachandran 6Balakumar Ramachandran 6 

List error

want to get the list of users returned in Username method query..how do i get it?? 

public class WV_ManualShareRead {
  
   List<Scheme__Share> users;
   List<User> userName;
   

    public List<User> getUserName()
    {
      if(userName == null)
          
              
               userName = [SELECT Name FROM user WHERE id = :users];
            
               return userName;
    }
   
    public List<Scheme__Share> getUsers() {

      
        if(users== null)
       
         
            users= [select UserOrGroupId from Scheme__Share where ParentId= :ApexPages.currentPage().getParameters().get('parentId')];
      
        return users;
               
           
     
    }
   
  
  
}
bob_buzzardbob_buzzard
I doubt this code will work because you are binding in the ids of user sharing objects and trying to use those as user ids.

You'll need to iterate the users list, pull the UserId from the records and store them in a list, then bind that list into your query,  That way you will be retrieving with valid user ids.
Balakumar Ramachandran 6Balakumar Ramachandran 6
thanks bob for your response. can you tell me how to correct this code..