• yuroker
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

Hi, Folks!

 

Does anybody know how to make more than 1 level nested Parent-to-Child query?

As I know there is a standard limitations for parent-to-child queries: "In each specified relationship, only one level of parent-to-child relationship can be specified in a query."

Sure I can provide some additional classes to solve the problem, but maybe somebody knows another way?

(kind of how to make additional request for query resulds:

        companiesList.addAll([

            Select Name, c.Conference__r.Id, c.Conference__c, c.Comapny_Contact__r.FirstName,

            (Select Name From PC_Track__r)  

            From cmp_Participating_Company__c c

            Where c.Conference__r.Id = 'a00A0000000q5nK'

        ]);

        

        for (cmp_Participating_Company__c company : companiesList)

        {

            for (cmp_Meeting_Track__c track : company.PC_Track__r)

            {

                track.Meeting_Track__r = [Select Name From cmp_Meeting__c];

            }

        } 

  • September 06, 2009
  • Like
  • 0