React to a Contact email change
An update trigger sees the new record in Trigger.new and the saved one in Trigger.oldMap, keyed by Id.
Your task
Complete beforeUpdate so a Contact's Description becomes 'Email changed' only when its Email actually changes.
public class AS_7BE5BEFCF051_ContactChanges {
public static void beforeUpdate(List<Contact> newContacts, Map<Id, Contact> oldMap) {
for (Contact contact : newContacts) {
Contact oldContact = oldMap.get(contact.Id);
}
}
}Requirements
- marksChangedEmail should pass
- keepsUnchangedEmail should pass
- handlesNullToValue should pass
- handlesValueToNull should pass
- ignoresCaseOnlyChange should pass
- handlesMixedBulkOfTwoHundred should pass