Skip to content
Suggest a correction

Check Contact emails for a placeholder domain

Example6 min read

Create a Record Health Check on an Account that reviews the email address of each related Contact and passes only when none uses a placeholder domain, such as @example.com. Blank email addresses are ignored, and the Check runs only after another Check confirms that the Account has a Contact. The example uses the Verify with a query Evaluation Type with a prerequisite Check.

The email addresses are on related Contacts, so one SOQL query returns them, and Every record passes tests each one. A Check finds placeholder addresses for cleanup without blocking Contact saves.

  • Install Record Health Check, and assign yourself Record Health Check Admin and the Salesforce Customize Application permission.
  • This Check uses the Has At Least One Contact Check as a prerequisite. Step 1 lists its values.
  • Replace @example.com with the placeholder text your organization uses. The comparison is case-sensitive, so @Example.com does not match @example.com.
  • Confirm that the people who will use the card can read Contacts and the Email field.

You can add the Check to an Account Check Set you already have. To create one, open Setup → Custom Metadata Types, select Manage Records next to Record Health Check Set, select New, enter these values, and save. Leave other fields at their defaults.

FieldValue
LabelAccount Related Record Review
ObjectAccount
Record Health Check Set NameAccount_Related_Record_Review
ActiveCleared until validation succeeds
Card TitleAccount Related Record Review
Card SubtitleConfirm related records are ready for handoff.
When Checks RunWhen the user clicks Run
Found/Expected DisplayShow on demand

This Check runs only after the Has At Least One Contact Check passes, so both Checks must be in this Check Set. If the Check Set does not have it yet, create it as described in Step 2, with these values:

FieldValue
LabelHas At Least One Contact
Check SetAccount Related Record Review
Evaluation TypeVerify with a query
Record Health Check NameHas_At_Least_One_Contact
Evaluation Order10
ActiveCleared until validation succeeds
Source QuerySELECT COUNT() FROM Contact WHERE AccountId = {!record.Id}
Source Query FieldLeave blank
How To Read Query ResultsOne row or aggregate
Comparison OperatorGreater than
Expected Value Comes FromFixed value
Expected Value (Fixed)0
Check TitleAccount has at least one Contact
Message When Failed{!record.Name fallback="This Account"} has no Contacts. Add at least one before handoff.
Failure SeverityWarning

Check that an Account has at least one Contact explains these values.

Open Setup → Custom Metadata Types, select Manage Records next to Record Health Check, select New, enter these values, and save.

FieldValue
LabelContact Emails Avoid Placeholder Domain
Check SetAccount Related Record Review
Evaluation TypeVerify with a query
Record Health Check NameContact_Emails_Avoid_Placeholder
Evaluation Order50
ActiveCleared until validation succeeds
Source QuerySELECT Email FROM Contact WHERE AccountId = {!record.Id}
Source Query FieldEmail
How To Read Query ResultsEvery record passes
Comparison OperatorDoes not contain text
Expected Value Comes FromFixed value
Expected Value (Fixed)@example.com
If Query Finds No RecordsSkip
If Field Value Is EmptyIgnore the record
Check TitleContact emails do not use a placeholder domain
Check DescriptionPasses when no Contact email on the Account contains @example.com. Blank emails are ignored.
Message When FailedSome Contacts on {!record.Name fallback="this Account"} use a placeholder email address.
Fix MessageReplace each placeholder with a verified email address, or clear it, following your data policy.
Failure SeverityWarning
Action LabelReview Contacts
Action URL/lightning/r/Account/{!record.Id}/related/Contacts/view
Display: Found Text{!rhcResult.failedRecordCount} of {!rhcResult.totalRecordCount} Contact emails use the placeholder domain
Display: Expected TextNo Contact email uses the placeholder domain
Applies ToAll records
Prerequisite CheckHas_At_Least_One_Contact

How the values work:

  • Does not contain text passes a row when its email does not include @example.com.
  • If Field Value Is Empty set to Ignore the record leaves Contacts with no email out of the review, so they neither pass nor fail it.
  • Prerequisite Check names the other Check by its Record Health Check Name. When Has At Least One Contact does not pass, this Check shows Skipped with the message “Skipped because Prerequisite Check “Has_At_Least_One_Contact” did not pass.” Prerequisites apply when the whole Check Set runs, as it does on the card.
  1. Run the Validate Record Health Check Configuration Flow action, as described in Validate configuration before activation, and correct every error.
  2. Activate Has At Least One Contact and this Check, then the Check Set.
  3. Add the Record Health Check component to the Account record page, select Account Related Record Review (Account_Related_Record_Review), and activate the page.
  4. Assign Record Health Check Card User to the users who test the card.

Select Run on the card for each case.

Contacts the user can seeEmail valuesResult on the card
0Not applicableSkipped, because the prerequisite failed
1BlankSkipped, with “Check skipped: the value under test was empty.”
2Both real addressesPass
2One contains @example.comWarning; Found reads “1 of 2 Contact emails use the placeholder domain”

A failed row shows Warning, the message, the fix message, a Review Contacts link, and the custom Found and Expected text. On an Account without Contacts the row shows Skipped and names the prerequisite.

What you seeWhat to check
The Check is always SkippedHas At Least One Contact is active, in the same Check Set, and passes for the Account.
A placeholder is not foundThe exact text and capitalization in Expected Value (Fixed).
A blank email failsIf Field Value Is Empty is Ignore the record.
Unable to CheckThe user can read Contacts and Email.