• Abhay_Zodape
  • NEWBIE
  • 15 Points
  • Member since 2016
  • Technical Lead
  • KPIT Technologies

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

Hi ,

 

i wrote a query which has an inner query in it to get the child records.

 

i will give an example with standard objects

 

Account acc = [select name,(select firtsname,lastname from Contact) from account limit 1];

 

i am using this "acc" varibale in VF page to display the contact records.

 

<apex:page>

<apex:repeat value="{!acc.contacts}" var="contact" >

 

<apex:outputtext value="{!contact.firstname}"/>

<apex:outputtext value="{!contact.lastname}"/>

</apex:repeat>

 

i have around 130 contacts, but iam getting below error message when i try to open the VF page to view the results.

 

"Aggregate query has too many rows for direct assignment, use FOR loop "

 

please let me know if anyone faced this issue earlier. what is the limit of number of rows in aggregate query.

is ithis is the correct way to get this done.

 

actually in my query there are around 15 inner object queries. that is my parent object has 15 childs.

 

any help would be appreciated

 

thanks in advance

 

Regards,

Rakesh