You need to sign in to do that
Don't have an account?
lopezc
Relationship query
Hi
I would like to retrieve information from the parent of the Account linked to a contact. The query is based on the object Contacts, is it possible to do it?
Something like:
Select Account.ParentId.FieldName__c from Contact
If they are not Child relationships you can access as many relationships as you want.
For example :
I think this is what you needed, let me know how it works out ,
Gaston.
All Answers
In case you want to access the field of Account object say FirstName, LastName then rephrase your query as given below:-
Select c.Account.FirstName, c.Account.LastName from Contact c
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
Hi,
I hope this helps.
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_soql_relationships.htm
No it doesn't. I want to go 2 levels above, so to the parent of the Account that it is the parent of the Contact
Something like "Select c.Account.Account.FirstName from Contact c" but that it doesn't work
If they are not Child relationships you can access as many relationships as you want.
For example :
I think this is what you needed, let me know how it works out ,
Gaston.
because there's no relationship called account on account, its called parent. (you should get confortable with one of the schema explorer tools).
select account.parent.name from contact