# Prevent Account Rating from Dropping from Hot

**Type:** Apex trigger · **Difficulty:** Medium · **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-rating-dropping-from-hot

## Problem

If an Account's Rating is Hot, do not allow an update to change it directly to Cold. Changing it to Warm or leaving it Hot is allowed.

## Constraints

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

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