Check Contact emails for a placeholder domain
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.
Why a query fits
Section titled “Why a query fits”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.
Before you start
Section titled “Before you start”- 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.comwith the placeholder text your organization uses. The comparison is case-sensitive, so@Example.comdoes not match@example.com. - Confirm that the people who will use the card can read Contacts and the Email field.
Step 1: Create or choose the Check Set
Section titled “Step 1: Create or choose the Check Set”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.
| Field | Value |
|---|---|
| Label | Account Related Record Review |
| Object | Account |
| Record Health Check Set Name | Account_ |
| Active | Cleared until validation succeeds |
| Card Title | Account Related Record Review |
| Card Subtitle | Confirm related records are ready for handoff. |
| When Checks Run | When the user clicks Run |
| Found/Expected Display | Show 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:
| Field | Value |
|---|---|
| Label | Has At Least One Contact |
| Check Set | Account Related Record Review |
| Evaluation Type | Verify with a query |
| Record Health Check Name | Has_ |
| Evaluation Order | 10 |
| Active | Cleared until validation succeeds |
| Source Query | SELECT COUNT() FROM Contact WHERE AccountId = {!record. |
| Source Query Field | Leave blank |
| How To Read Query Results | One row or aggregate |
| Comparison Operator | Greater than |
| Expected Value Comes From | Fixed value |
| Expected Value (Fixed) | 0 |
| Check Title | Account has at least one Contact |
| Message When Failed | {!record. |
| Failure Severity | Warning |
Check that an Account has at least one Contact explains these values.
Step 2: Create the Check
Section titled “Step 2: Create the Check”Open Setup → Custom Metadata Types, select Manage Records next to Record Health Check, select New, enter these values, and save.
| Field | Value |
|---|---|
| Label | Contact Emails Avoid Placeholder Domain |
| Check Set | Account Related Record Review |
| Evaluation Type | Verify with a query |
| Record Health Check Name | Contact_ |
| Evaluation Order | 50 |
| Active | Cleared until validation succeeds |
| Source Query | SELECT Email FROM Contact WHERE AccountId = {!record. |
| Source Query Field | Email |
| How To Read Query Results | Every record passes |
| Comparison Operator | Does not contain text |
| Expected Value Comes From | Fixed value |
| Expected Value (Fixed) | @example. |
| If Query Finds No Records | Skip |
| If Field Value Is Empty | Ignore the record |
| Check Title | Contact emails do not use a placeholder domain |
| Check Description | Passes when no Contact email on the Account contains @example.com. Blank emails are ignored. |
| Message When Failed | Some Contacts on {!record. |
| Fix Message | Replace each placeholder with a verified email address, or clear it, following your data policy. |
| Failure Severity | Warning |
| Action Label | Review Contacts |
| Action URL | /lightning/r/Account/{!record. |
| Display: Found Text | {!rhcResult. |
| Display: Expected Text | No Contact email uses the placeholder domain |
| Applies To | All records |
| Prerequisite Check | Has_ |
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.
Step 3: Validate and activate
Section titled “Step 3: Validate and activate”- Run the Validate Record Health Check Configuration Flow action, as described in Validate configuration before activation, and correct every error.
- Activate Has At Least One Contact and this Check, then the Check Set.
- Add the Record Health Check component to the Account record page, select Account Related Record Review (Account_Related_Record_Review), and activate the page.
- Assign Record Health Check Card User to the users who test the card.
Step 4: Test the Check
Section titled “Step 4: Test the Check”Select Run on the card for each case.
| Contacts the user can see | Email values | Result on the card |
|---|---|---|
| 0 | Not applicable | Skipped, because the prerequisite failed |
| 1 | Blank | Skipped, with “Check skipped: the value under test was empty.” |
| 2 | Both real addresses | Pass |
| 2 | One contains @example. | Warning; Found reads “1 of 2 Contact emails use the placeholder domain” |
What users see
Section titled “What users see”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.
Resolve problems
Section titled “Resolve problems”| What you see | What to check |
|---|---|
| The Check is always Skipped | Has At Least One Contact is active, in the same Check Set, and passes for the Account. |
| A placeholder is not found | The exact text and capitalization in Expected Value (Fixed). |
| A blank email fails | If Field Value Is Empty is Ignore the record. |
| Unable to Check | The user can read Contacts and Email. |