# What is the difference between before triggers and after triggers?

**Topic:** Apex Trigger · **Difficulty:** Easy · **Asked at:** Deloitte, Accenture, Wipro · **Tags:** apex-trigger, trigger, fundamentals

Read it on the site: https://www.forcechallenges.com/interview-questions/what-is-the-difference-between-before-triggers-and-after-triggers

## Answer

**Before triggers** run before the record is saved to the database. Use them to validate or modify field values on the records in `Trigger.new` without an extra DML, since changes are saved automatically. Record Ids are not yet available on insert.

**After triggers** run after the record is saved (but not committed). Record Ids and system-populated fields (CreatedDate, formula values) are available. Use them to create or update *related* records. Records in `Trigger.new` are read-only.

Rule of thumb: before = same-record changes and validation; after = related-record changes and logic needing the Id.

---
Source: ForceChallenges · last updated 2026-10-21
