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
santoshsantosh 

SELECT query limit

Hello,
 
I am writing an APEX trigger in which I am making a simple SELECT query and bulk-deleting the records thus obtained using delete <List>. When this trigger runs on a bulk operation, I am constantly getting a result exceeded error (> 21); what are the limits governing APEX code if at  all there's one?
 
Thanks
TCAdminTCAdmin
Hello santosh,

This is normally caused by having a query within a loop. You will need to move your query outside of any loop and then manipulate the query results within the loop to prevent too many queries happening when doing an action.