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
Chandu007Chandu007 

EXCEEDED_ID_LIMIT: Aggregate query does not support queryMore(), use LIMIT to restrict the results to a single batch

I am trying to fetch Duplicate Records based on certain field but hitting below error. Please help me if my query is wrong.

Query:-  SELECT MHC2__MHC_Project_ID__c, count(Id) FROM MHC2__Project__c GROUP BY MHC2__MHC_Project_ID__c HAVING count(Id)>1 limit 1000


Error:- EXCEEDED_ID_LIMIT: Aggregate query does not support queryMore(), use LIMIT to restrict the results to a single batch

when i tried to get them to CSV then hitting below error

Failed: InvalidBatch : Failed to process query: FUNCTIONALITY_NOT_ENABLED: Aggregate Relationships not supported in Bulk Query


Thanks,
Chandra
Kumaresan.ManickamKumaresan.Manickam
Hi Chandra,

If you are using aggregate functions in SOQL use SOQL statement separately instead of SOQL for loops as SOQL for loops is normally for processing large set of records to avoid heap size. You can still use Aggregate functions in SOQL for loop with limitation of handling maximum of 2000 results. If it exceeds system will throw run time exception.

Your problem is already reported and answered in another question: https://success.salesforce.com/answers?id=9063A000000Do2cQAC

Choose this answer a best answer if it solves your problem.

Best of luck.