ForceChallenges
ProblemsDailyNotes
Sign in
Problem list
Sign in to submit

Block Case Reopening after Resolution

MediumApex Triggeron Case 25 ptsCreated Oct 13, 2026

Do not allow a Case that was Closed to be changed back to New. Other status changes are allowed. Use old and new values to detect the reopening attempt.

Constraints

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

CaseTrigger.oldMapBefore Update
CodeApex
Loading editor…
Closed case cannot return to New

Seed data

Case× 1 rows
Origin: WebStatus: ClosedSubject: Done

DML under test

updateCaseWHERE Subject = 'Done'
SET
Status: New

Expected