function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
cardozamancardozaman 

Inline Account Hierarchy v1.1 error - "Inline query has too many rows for direct assignment, use FOR loop ....

Appexchange app.... over 70,000 accounts in org.

 

Code rookie wondering if anyone can help me with the syntax to edit a Class named AccountStructure which I think is actually doing the query/throwing the error.

 

First of all am I barking up the right tree?  this segment of code causing that error.

and secondly, can it be written as a for loop?

 

Section below is where I'm guessing would be changed if possible.

 

if(level==0){
//
// Change below
//
al = [SELECT a.Type, a.Site, a.ParentId, a.OwnerId, a.Name, a.Industry,
a.Id FROM Account a WHERE a.id IN :CurrentParent ORDER BY a.Name];
//
}
else {
//
// Change below
//
al = [SELECT a.Type, a.Site, a.ParentId, a.OwnerId, a.Name, a.Industry,
a.Id FROM Account a WHERE a.ParentID IN :CurrentParent ORDER BY a.Name];
//
}

 

Link to the customization guide.

 

http://sites.force.com/appexchange/servlet/servlet.FileDownload?retURL=%2Fappexchange%2Fapex%2Fuploadedcontent%3Fid%3D00P30000003TbpsEAC&file=00P30000003TbpsEAC

 

Any help is appreciated.

Thank you!