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
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..