# Prevent Account Name Changes

**Type:** Apex trigger · **Difficulty:** Hard · **Object:** Account · **Topics:** Account, Trigger.oldMap, Before Update

Practice this problem interactively (write and run your Apex trigger against realistic data): https://www.forcechallenges.com/problems/prevent-account-name-changes

## Problem

After an Account has been created, do not allow its Name to change. Other Account fields can still be updated. Use Trigger.oldMap to compare the old and new names.

## Constraints

Keep the trigger bulk-safe. Do not run SOQL or DML inside a loop.

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