# Require Resolution Before Closing a Case

**Type:** Apex trigger · **Difficulty:** Easy · **Object:** Case · **Topics:** Case, Validation, Before Update, addError

Practice this problem interactively (write and run your Apex trigger against realistic data): https://www.forcechallenges.com/problems/require-resolution-before-closing-case

## Problem

When a Case is inserted or updated with Status Closed, require the Resolution field to contain an explanation. Add a custom Resolution field if the standard practice org does not have one. Cases in other statuses can have an empty resolution.

## Constraints

Keep the trigger bulk-safe and put no SOQL or DML statements inside loops.

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