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
rornelasrornelas 

how to query manual sharing object?

Hello, I've been trying to find a way to query the salesforce sharing object and haven't found a way other than the API. Does anybody know the syntax to a query sharing object in Salesforce? or how I would do it via the api
AnkaiahAnkaiah (Salesforce Developers) 
Hi,

try with below query.

Query on a standard object’s share records:
 
SELECT Id, AccountId, UserorGroupId, AccountAccessLevel, RowCause
FROM AccountShare
WHERE AccountId = '001frgthyjugggt001'

Query on a custom object’s share records:
SELECT Id, AccountId, UserorGroupId, AccountAccessLevel, RowCause
FROM Customobject__Share
WHERE ParentId = 'a0K0o00000o7gm5'

If this helps, Please mark it as best answer.

Thanks!!​​​​​​​