+ Start a Discussion
Mike @ BlackTabMike @ BlackTab 

Query User/Queue Name from AccountShares Object

Hello,

 

I have this simple query:

 

public List<AccountShare> getAccountShares (){
        return [SELECT Account.Name, id, AccountAccessLevel, AccountId, RowCause, UserOrGroupId FROM AccountShare WHERE RowCause != 'Owner'];
    }

 However I'm not sure how to acess the related User/Queue name from the UserOrGroupId field. Do I need a wrapper class?

 

Thanks

DuDuDuDu
Hello,
Try this query , I hope can help you.
SELECT AccountAccessLevel,AccountId,Id,UserOrGroupId,UserOrGroup.Name FROM AccountShare