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
Tom Barad 11Tom Barad 11 

Setting List Size for Bulkified Triggers

Hi everyone -

I have a large installed package that contains a ton of apex.  When I load data using data loader, I frequently have to lower the batch size from 200 to 10 in order for rows to be processed against account or contact without it throwing Apex SOQL errors.  I've coded my own bulkified apex, which is trying to process 200 records at a time, so I'm running into the same Apex SOQL errors I receive from data loader.  I can't seem to find a way to limit the number of records that can be processed in a bulkified apex.  Does anyone know if this is possible?  

Thanks in advance -
Tom
Vishal_GuptaVishal_Gupta
Hi Tom,

Where you are getting the SOQL error means in package code or out of package code. If its in package code then you need to ask from the support team of package provider to make changes in code to hndle bulkify data and if issue coming in your out of package code then you need to make code more effecient to handle SOQL error.

As you told in above post that you have coded bulkified apex, it is a batch or custom code which execute from the front end?

Thanks,
Vishal
Tom Barad 11Tom Barad 11
Thanks, Vishal, for your quick response.  It's a managed package and the vendor is aware of the issues.  They are doing their best to correct the problems, but the solution is likely a long time coming.  

The apex I wrote is executed by pushing a button on a visualforce page. 

Tom
Vishal_GuptaVishal_Gupta
Hi Tom,

You can use the Apex Batch instead of button on Visualforce becuase in Apex batch SOQL limit is just double that is 200 and also you have option to provide number of records which you want to process in a single batch to avoid the SOQL issue.

Please let me know if I can help you more.

Thanks,
Vishal