Development questions
If a batch of 250 records is inserted via Data Loader, how many times does the trigger execute and how are governor limits shared?
Triggers always process records in chunks of up to 200, so 250 records means two trigger invocations (200 + 50).
- In a single Apex transaction (e.g.
insert listof 250), both chunks run in the same transaction and share one set of governor limits. - Through the Bulk API / Data Loader in Bulk mode, each 200-record chunk is processed as its own transaction with fresh limits.
- Data Loader on the SOAP API sends at most 200 per call.
That is why triggers must be bulk-safe: code must work for a full 200-record chunk within limits.
apex-triggertriggergovernor-limitsbulk
More Development questions
- What is an Apex Trigger in Salesforce and when should you use it over Flows?
- What is the difference between before triggers and after triggers?
- Explain all Trigger context variables (isInsert, isUpdate, isDelete, isUndelete, isBefore, isAfter, isExecuting, size, operationType).
- What is the difference between Trigger.new and Trigger.old?
- In which trigger events are Trigger.new and Trigger.newMap available?
- In which trigger events are Trigger.old and Trigger.oldMap available?