You need to sign in to do that
Don't have an account?
Relationship Queries with the Partner WSDL
- The relationshipName value for one-to-many relationships, for example, in an account object, the relationship name for the asset child is Assets.
- Use the reference fields available for the relevant object, for example, whoId, whatId, or ownerId on a lead, case, or custom object."
I can't make this into sense. Let's make things specific so they are easier to follow. Say I want to run one of the example queries relating accounts and contacts from the docs. describeSObject on Account gives me a childRelationship[] that shows me that I've got one relating AccountId and Contact called "Contacts". I confess that I don't follow what the second bullet is saying. So how do I build this up into a query? Where do I put my relationshipName? It doesn't seem to be included in any of the examples.
An example in the docs:
SELECT Id, FirstName, LastName, AccountId, Account.Name FROM Contact WHERE Account.Name LIKE ’Acme%’I can't run this query, because I get a MALFORMED_SQL error about not being able to query relationships.
That note at the end of the doc page quote above makes me think that I can, if only I could build up the
query correctly. Any advice?
Message Edited by DevAngel on 01-10-2007 10:03 AM
http://blog.sforce.com/sforce/2007/01/soql_relationsh.html
As for the error, you can only run SOQL relationship queries on the 8.0 API.
If you download the QueryAmp beta at www.queryamp.com , you can use it to better understand the new 7.0 relationships. QueryAmp has a graphical SOQL builder and will let you view the relationship metadata as well as the resulting SOQL statement.
QueryAmp is currently in a free-to-use beta period but will eventually be fee-based.
Bill
forceAmp.com