+ Start a Discussion
stratus adminstratus admin 

Share Qurey

Hi can someone help me out? I'm trying to do a SOQL query on a Share object to get the users names granted access to a custom object. I can't seem to join to the user table. This is the basic Query:

Select s.AccessLevel, s.Id, s.LastModifiedDate, s.UserOrGroupId from SFL5_Projects__Share s where s.RowCause = 'Manual'

Is it possible to get user names from this, or do I have to take the results of this an loop over another query?




According to the Ajax documentation, for Child-to-Parent you can use:

var result = sforce.connection.query("SELECT c.Id, c.firstname, " + "c.lastname, c.leadsource, a.Id, a.name, a.industry, c.accountId " + "FROM Contact c, c.account a ORDER BY leadsource LIMIT 10");


For Parent-to-Child, try something like:

var result = sforce.connection.query("select a.Name, a.Industry, " +"(select c.LastName, c.LeadSource from a.Contacts c) " +"from account a order by industry limit 100");

stratus adminstratus admin
For some reason the share objects don't seem to support relationships, at least as you (and the documentation) define them. I'm wondering if there is a special way to query the sharing objects..