Require a Contact email domain
A before-trigger handler can reject a single record with a field-level addError.
Your task
Finish the validator so Contact Emails that are not blank must end with @example.com.
public class AS_4752F6B3261E_EmailValidator {
public static void validate(List<Contact> contacts) {
for (Contact item : contacts) {
if (String.isBlank(item.Email)) {
continue;
}
}
}
}Requirements
- acceptsAllowedDomain should pass
- rejectsOtherDomainOnEmailField should pass
- rejectsLookalikeDomains should pass
- allowsBlankEmails should pass
- protectsExistingRecordOnUpdate should pass
- handlesMixedBulkOfTwoHundred should pass