- 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
-
Discussions
- Announcements
- General Development
- Schema Development
- New to Cloud Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules Discussion
- Security
- Mobile
- Force.com Sites
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby Development
- Adobe Flash Builder for Force.com
- Desktop Integration
- REST API Integration
- Streaming API
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- Excel Connector
- AJAX Toolkit & S-controls
- Force.com Builder & Native Apps
- AppExchange Directory & Packaging
- Force.com Labs Projects
- Open Source
- Site.com
- Jobs Board - Administrators
- Jobs Board - Developers
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Schema Development
- :
- Re: How to create SOQL for recursive relationship ...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
How to create SOQL for recursive relationsh ip on Contact ?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-08-2012 07:30 AM
we have table "Contact". There are fields Id, Name and Reports To fields and so on.
The "Reports To" field is lookup to Contact.
Here, I would like to find Contact --> Contact's Supervisor ----> Contacts Supervisor's Supervirsor ---> and so on.
Can you please explain how to define this relationship using SOQL?
Best Regards
Gowtham
Re: How to create SOQL for recursive relationsh ip on Contact ?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-09-2012 03:44 AM
You can not directly achieve the entire hierarchy of contacts with single SOQL. you will need to write a bit of Apex.
Re: How to create SOQL for recursive relationsh ip on Contact ?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-10-2012 10:36 PM
Thanks a lot for responding to my message.
Could you please guide me on how to write Apex code.
I am new to Saleforce. Please help me here.
Best Regards
Gowtham
Re: How to create SOQL for recursive relationsh ip on Contact ?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-21-2012 04:38 PM
Here is a link to the official apex code developer guide : http://www.salesforce.com/us/developer/docs/apexco
It has useful information and examples to get you started.

