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
PekPek 

Trigger using @future example

I have a trigger which needs to query more than 1000 records. I would like to convert it to use @future in order to work around the governor limit.

 

Do I have to move the logic out of the trigger to a class?

Do you have an example of how I would use @future in this case?

 

Thanks

Pierre

ascuccimarraascuccimarra

I don't think moving this to a future method would help. Future methods run async, but don't increase limits.

I think what should help you is batch apex, that way you can do batch processing for every 1000 records. 

Hope this helps.