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
Lars SundbergLars Sundberg 

Listing all users that has access to a certain record

When listing records of a custom object, I'd also like to list all users that has access to it.

 

Can I access ObjectName__Share somehow and work from there?

Best Answer chosen by Admin (Salesforce Developers) 
Taiki YoshikawaTaiki Yoshikawa

Hi,

 

You can check at  UserOrGroupId Field

 

List<ObjectName__Share> lists = [select UserOrGroupId from ObjectName__Share];

 

 

 

 

All Answers

Taiki YoshikawaTaiki Yoshikawa

Hi,

 

You can check at  UserOrGroupId Field

 

List<ObjectName__Share> lists = [select UserOrGroupId from ObjectName__Share];

 

 

 

 

This was selected as the best answer
Lars SundbergLars Sundberg

Thanks!