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
Bhanu joshi 10Bhanu joshi 10 

Viewing a record, how we determine to whom user this records are shared ?

How to determine , to whom a record is shared . Like i have a account records. I would like to know to which users this record is shared ...
I know i need to check sharing settings etc . But other way to accomplish this
Waqar Hussain SFWaqar Hussain SF
You can either click on Sharing button on the account record, which will show you to whom it is shared. 

Or you can also query it using SOQL
 
List<AccountShare> Shares = [Select AccountId, AccountAccessLevel, UserOrGroupId from AccountShare];

Regards,
Waqar​
Bhanu joshi 10Bhanu joshi 10
thanks for your replay 
AccountShare is only limited to account object and we need to insert record also on this
but what if i want to use for custom object.
Waqar Hussain SFWaqar Hussain SF
If you want to share custom object using apex, you can use customObject__share object such as 

Invoice__share

Please see 
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_bulk_sharing_creating_with_apex.htm