You need to sign in to do that
Don't have an account?
Sumit Kumar Singh 9
Get all the user who have access to particular Account record in Salesforce.
I want to get list of user in ApEX cladd who have access to particular Account record in Salesforce.
You can query AccountShare object to get list of all users or groups that are having access to the account.
Please use below query in yout apex class.
SELECT AccountAccessLevel,AccountId,CaseAccessLevel,ContactAccessLevel,Id,RowCause,UserOrGroupId FROM AccountShare where AccountId ='YourAccountID'
Column UserOrGroupId will contain list of users you're looking for. You can query additional infor as well like access level and all.
For more detail please refer below link.
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_accountshare.htm
Hope this will help ! Cheers ! Keep Salesforcing !