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
rajaram.adminrajaram.admin 

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

Hi

 

give me the reply

 

 

 

Thanks & Regards

 

Rajaram.

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)

yvk431yvk431

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.

 

--yvk