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
Ken_KoellnerKen_Koellner 

System.Exception: retrieve id limit reached

Anyone know exactly what that message means and how things are counted?  There's nothing stated as an "id limit" in the table of limits in the Apex manual.

 

 

 

Select o.Id, o.Line_Item_Status__c, o.OpportunityId, 
o.Opportunity.AccountId, 
o.Opportunity.Account.parentId, 
o.Opportunity.Account.parent.parentId, 
o.Opportunity.Transaction_Type__c from OpportunityLineItem o  where o.Line_Item_Status__c = 'Shipped'
and o.Opportunity.transaction_type__c = 'xyzzy'

 

 

I limited added a limit 9999 on the end of that and still hit the limit.  I'm wondering if the 10,000 limit is not just on the primary table of the query, OpportunityLineItem, but on all the tables.  Thus each row visited in OpportunityLineItem, Opportunity, and Account added up must be not greater > 10,000. 


Is that how the limit works?

 

Scott.MScott.M

Hmm that would really suck. I'd like to test it but I doubt I could get 10000 records into the 5mb data limit of the dev orgs :)

Ken_KoellnerKen_Koellner

 I tried that query in an apex method that read the result into a list.  When I included LIMIT 8500, it succeeded.  When I included LIMIT 8750, it hit the exception.

 

 

Ken_KoellnerKen_Koellner

Simplified the query and still hit the limit at the same time.

 

 

Select o.Id, o.Line_Item_Status__c, o.OpportunityId, 
o.Opportunity.AccountId, 
o.Opportunity.Transaction_Type__c from OpportunityLineItem o  where o.Line_Item_Status__c = 'Shipped'
and o.Opportunity.transaction_type__c = 'xyzzy'