ForceChallenges
ProblemsDailyNotes
Sign in
Problem list
Sign in to submit

Prevent Lead Email Changes after Qualification

MediumApex Triggeron Lead 25 ptsCreated Oct 13, 2026

When a Lead is already Qualified, do not allow its Email to change. Email changes for leads in other statuses are allowed.

Constraints

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

LeadTrigger.oldMapBefore Update
CodeApex
Loading editor…
Qualified lead email is locked

Seed data

Lead× 1 rows
Email: old@example.comStatus: QualifiedCompany: AcmeLastName: Qualified

DML under test

updateLeadWHERE LastName = 'Qualified'
SET
Email: new@example.com

Expected