04 · Bulkification: 200 records or bust

Triggers receive up to 200 records at once. Every query and DML statement inside a loop is a countdown to 'Too many SOQL queries: 101'.

Article 15m 1 min read Updated 17 Jul 2025
04 · Bulkification: 200 records or bust
Modules

Triggers receive up to 200 records at once. Every query and DML statement inside a loop is a countdown to 'Too many SOQL queries: 101'.

The discipline

Collect Ids in a loop, query once into a Map, look up inside the loop, collect changes, DML once at the end. Every bulk-safe trigger is that sentence, rearranged.

Test at 200

A test that inserts one record proves nothing about limits. Insert a List of 200 and your future data-loader migrations stop being surprises.

Practice in your org

  • Open your Developer Edition org and follow along step by step
  • Change one thing at a time and note what happens
  • When something breaks, read the error before searching for it