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
Guy BeaudryGuy Beaudry 

CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY:AccountTrigger: execution of BeforeUpdate caused by: System.QueryException: Aggregate query has too many rows for direct assignment, use FOR loop

Hi, I'm using Talend as a development plateform, I use the Saleforce objects to do an UPSERT on the module ACCOUNT and I'm getting the error above for 3000 out of 370,000 rows. I don't do any queries, the object is doing everything for me. What would be the problem here?

Thank you for your help.
Best Answer chosen by Guy Beaudry
Raj VakatiRaj Vakati
You have two options now .. 
  • Reduce the batch size while loading the data from Talend 
  • Or Fix the trigger  

All Answers

Raj VakatiRaj Vakati
You have two options now .. 
  • Reduce the batch size while loading the data from Talend 
  • Or Fix the trigger  
This was selected as the best answer
Guy BeaudryGuy Beaudry
Problem solved. The field Experian_ID__c is decpricated and was causing a trigger to fire and that was the cause of the problem. So, I don't update that field and everything works as expected. Thank you!