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