+ Start a Discussion
Mario PMario P 

SOQL statements can't query related data


I tried one standard query from Apex Web Services API Developer's Guide topic Relationship Queries
SELECT Contact.FirstName, Contact.Account.Name from Contact
and I received an error: "SOQL statements  can't query related data"

When I try to create querues using just only one object/table it works fine, but when there are more than one - it fails.

As I understand sample queries (from RTFM) with predefined objects/tables should work fine.

What the problem is?

Thanks a lot in advance.
You're using an API version older than 8.0
Mario PMario P
Thanks a lot!
Now response recieved with no errors.

But now I chaged the version in my s-Control:
<script language="javascript"
src="https://www.sforce.com/ajax/beta1/sforceclient.js" type="text/javascript"></script>
<script language="JavaScript">
sforceClient.init("{!API.Session_ID}", "{!API.Partner_Server_URL_100}");

And I got an error:
responseNode has no properties

Now the problem is in JS tool.
I guess that I'm using the wrong version of js-file. Should I use another url instead of "https://www.sforce.com/ajax/beta1/sforceclient.js"?

Thank you.
/ajax/beta1/sforceclient.js whoa, that's old and is pre SOQL-R. You'll need to update to the production ajax toolkit, there's migration details included in the docs.

I am getting similar problem.

Basically same SOQL statement works fines when calling in C# code,
but failed when calling from a s-control on sandbox.

My s-control points to "/soap/ajax/10.0/connection.js"

Can anyone help? thanks.




I was stupid - I updated login url in config file on my development machine but forgot to update it on the test web server.
My s-control calls a SOAP method sitting at our web server.