A sharing rule exists in Account which under certain criteria shares the record with a Role.
Is there a way we can query AccountShare object or any other table to check what Roles are Accounts shared with?
The relatedId in Group object says "For Groups of type “Role,” the ID of the associated UserRole."
Best Answer
Yes sure.
You can use SOQL like bellow:
This will give you all account rows those are shared to Role. If you are interested in perticuler role then you can add condition like AND WHERE UserOrGroupId = 'ROLE_ID_XXXX'