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

In a trigger there are 1000 records how can you execute 200 records for each batch?



give me the reply




Thanks & Regards



Laxman RaoLaxman Rao

Trigger can have maximum of 200 records, If it has more than 200 salesforce divides into batches of 200.


For example if you insert 1000 records using dataloader, then trigger will call 5 times(200 each batch)


per my understanding you want to execute the records in batches retrieved from a trigger, for that you can just have a future method which takes a set/list of ids . you will just iterate through list of records and when the record count hits the mulitples of 200 you will call your future method and clears the list.