- Home
- Technical Library
- Boards
- Cookbook
- Code Share
- Blogs
- Partners
-
More
-
Services
- Training & Certification
- Support
-
Galleries
- Force.com Sites Gallery
- Chatter Challenge Entries
-
Other Web Sites
- Salesforce.com
- Database.com
- AppExchange
- CRM Community
-
Add Recipe
App Distribution (13)
Bundle logic, interface and services for distribution.
App Logic (52)
The Apex programming language, workflow and formulas for logic.
Collaboration (7)
The Salesforce Chatter collaboration platform.
Database (29)
Data persistence, reporting and analytics.
Integration (57)
Web Service APIs and toolkits for integration.
Security (22)
Platform, application and data security.
Tools (17)
Force.com tooling
User Interface (38)
Visualforce MVC and metadata-drive user interfaces.
Web Sites (13)
Public web sites and apps with optional user registration and login.
Beta Feedback
Recipes by Category
App Distribution (13)
Bundle logic, interface and services for distribution.
App Logic (52)
The Apex programming language, workflow and formulas for logic.
Collaboration (7)
The Salesforce Chatter collaboration platform.
Database (29)
Data persistence, reporting and analytics.
Integration (57)
Web Service APIs and toolkits for integration.
Security (22)
Platform, application and data security.
Tools (17)
Force.com tooling
User Interface (38)
Visualforce MVC and metadata-drive user interfaces.
Web Sites (13)
Public web sites and apps with optional user registration and login.
Cookbook Home » Using Relationship Queries
Share
X
Vote to Verify a Recipe
Verifying a recipe is a way to give feedback to others and broaden your own understanding of the capabilities on Force.com. When you verify a recipe, please make sure the code runs, and the functionality solves the articulated problem as expected.
Please make sure:- All the necessary pieces are mentioned
- You have tested the recipe in practice
- Have sent any suggestions for improvements to the author
Please Log in to verify a recipe
You have voted to verify this recipe.
© Copyright 2000-2011 salesforce.com, inc. Web-based Customer Relationship Management (CRM) Software-as-a-Service (SaaS).
All rights reserved Various trademarks held by their respective owners.
All rights reserved Various trademarks held by their respective owners.
Salesforce.com, inc. The Landmark @ One Market, Suite 300, San Francisco, CA, 94105, United States
General Enquiries: 415-901-7000 | Fax: 415-901-7040 | Sales: 1-800-no-software
General Enquiries: 415-901-7000 | Fax: 415-901-7040 | Sales: 1-800-no-software

Recipe Activity - Please Log in to write a comment
Its a nice article. But here, there is no example where there is a child-Parent relationship on a single table.
For example, we have table "Contact". There are fields Id, Name and Reports To fields.
The "Reports To" field is again lookup to Contact.
Can you please explain how to define this relationship using SOQL?
Best Regards
Gowtham
Sorry about the problem in the example all - it's fixed now.
For "Basic Parent-to-Child (Aggregate) Traversal", they probably meant something like:
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco} span.s1 {color: #961a65} span.s2 {color: #2f41e2}
SELECT Id, AccountId, Name, (SELECT Quantity, TotalPrice from OpportunityLineItems) from Opportunity
Nice ... the examples for "Basic Parent-to-Child (Aggregate) Traversal" and "Combined Child-to-Parent and Parent-to-Child Traversal" are botched. They are the same as the previous two examples and do not even contain the same Object Name offered in the text.
yeah, it's pretty bad when the query is just copy/pasted multiple times...and worse that this is already in the documentation, and probably a botched copy/paste from that...
This would be helpful but at the moment the SELECT statement syntax is exactly the same on each example. I think it needs to be reviewed!