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
JCSJCSJCSJCS 

Help with Custom Object Shares query....

Hello - I am trying to write an SOQL query to pull data from the SF share object related to one of my custom objects.

I am using Explorer to generate the query - but it does not work.  I have reviewed the SOQL guide on relationships and am a bit lost on why this does not work.

My custom object is called DEALS and the DEALS__SHARE object was automatically created by SF to track any sharing associated with the records in this object.  Any help getting this "join" to work is appreciated.

I am basically trying to get the AccessLevel, RowCause, and UserName (from the user table) from the Deal__share object and user object.

The suggested Explorer query and the error:

(Note: this works fine without the UserOrGroup.Name field.  I believe this should refer to the group or user assigned the share permissions)

SELECT Id, AccessLevel, RowCause, UserOrGroup.Name FROM Deals__Share LIMIT 20

faultcode    sf:INVALID_FIELD
faultstring    INVALID_FIELD: SELECT Id, AccessLevel, RowCause, UserOrGroup.Name FROM Deals__Share ^ ERROR at Row:1:Column:35 Didn't understand relationship 'UserOrGroup' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.


jcsjcs