Create your first Check
Build a working Record Health Check in a Salesforce sandbox without code. You create a Check Set and one formula Check that asks “Does this Account have a Billing City?”, validate the configuration, add the card to an Account record page, and confirm that it passes and fails as expected.
Record Health Check stores its configuration as two Custom Metadata Types. A Record Health Check Set record, called a Check Set, defines one card for one object. A Record Health Check record, called a Check, defines one requirement on that card.
Before you start
Section titled “Before you start”You need:
- Record Health Check installed in a sandbox. See Install Record Health Check in a sandbox.
- The Record Health Check Admin Permission Set.
- The Salesforce Customize Application permission, which Record Health Check Admin does not include. You need it to create Custom Metadata records in Setup.
- Permission to edit Lightning record pages in Lightning App Builder.
- An Account in the sandbox that you can edit.
- A second user for testing who has the Record Health Check Card User Permission Set and Read access to Account and the Billing City field. Results depend on the running user’s access, so test as a user who has the same access as the people who will use the card.
You do not need Apex or the Salesforce CLI.
What you will create
Section titled “What you will create”| Record | Label | API name (Developer Name) | Purpose |
|---|---|---|---|
| Record Health Check Set | Account Readiness | Account_ | Defines the card on Account record pages |
| Record Health Check | Billing City Is Populated | Billing_ | Passes when Billing City has a value, and fails when blank |
You create both records inactive, validate them, and then activate them. Keeping them inactive until validation succeeds keeps unfinished configuration away from users.
Step 1: Create the Check Set
Section titled “Step 1: Create the Check Set”-
In Setup, enter
Custom Metadata Typesin Quick Find, then select Custom Metadata Types. -
Next to Record Health Check Set, select Manage Records.
-
Select New.
-
Enter these values. Leave every other field at its default.
Field Value Label Account Readiness Record Health Check Set Name Account_Readiness Object AccountCard Title Account Readiness When Checks Run When the user clicks Run Card Heading Display Show title and subtitle Run Button Display Show label and icon Summary Display Show below checks Active Cleared -
Select Save.
Record Health Check Set Name is the record’s API name. Flow, Apex, and Checks refer to the Check Set by this name. Object must be the object’s API name, spelled exactly as Salesforce spells it. When the user clicks Run makes the card wait for you to select Run, so you can see exactly when the result changes during the test.
Result: The Account Readiness Check Set appears in the list with Active cleared.
Step 2: Create the Check
Section titled “Step 2: Create the Check”-
Return to Custom Metadata Types.
-
Next to Record Health Check, select Manage Records.
-
Select New.
-
Enter these values. Leave every other field at its default.
Field Value Label Billing City Is Populated Record Health Check Name Billing_City_ Is_ Populated Check Set Account Readiness Check Title Billing City is populated Evaluation Type Verify with a formula Pass Condition NOT(ISBLANK(BillingCity))Failure Severity Warning Message When Failed {!record.Name fallback="This Account"} is missing a Billing City. Fix Message Add the Billing City, save the Account, and run the Check again.Action Label Edit AccountAction URL /lightning/r/Account/{!record.Id}/edit Evaluation Order 10Active Cleared -
Select Save.
What these values do:
- Pass Condition is a Salesforce formula that runs against the open Account. It returns true, which is a pass, when Billing City has a value.
{!record.Name fallback="This Account"}is a merge token. The card replaces it with the Account Name. If the running user cannot read the Name, the card shows “This Account” instead.- Action URL opens the standard edit page for the same Account.
{!record.Id}becomes the Account ID. The link only opens the page; it saves nothing. - Failure Severity set to Warning makes a failed result show the Warning label in amber.
Result: The Billing City Is Populated Check appears in the list with Active cleared.
Step 3: Validate the configuration
Section titled “Step 3: Validate the configuration”Record Health Check includes a Flow action, Validate Record Health Check Configuration, that checks every Check Set and Check, including inactive ones. It reports problems such as missing required values, settings that cannot work together, invalid merge tokens, unusable formulas or queries, a missing Apex class, and prerequisite Checks that are missing or circular. It reads only configuration, never business records.
If you already have a validation Flow, open it and select Debug, then go to step 8.
-
In Setup, enter
Flowsin Quick Find, then select Flows. -
Select New Flow, then select Autolaunched Flow (No Trigger).
-
Add an Action element.
-
Search for and select Validate Record Health Check Configuration.
-
Enter
Validate_configurationas the API name, then select Done. -
Save the Flow as Validate Record Health Check Configuration. Do not activate it.
-
Select Debug, then select Run.
-
In the debug details, review the action’s outputs.
Output Required result Configuration Is Valid trueError Count 0Warning Count Any number. Read each warning in Validation Report JSON and decide whether to fix it. -
If Error Count is greater than zero, find each error in Validation Report JSON. Each entry names the record in
componentName, the field infieldName, and the problem inmessage. Correct the record in Setup, and then debug the Flow again.
Result: Configuration Is Valid is true.
Step 4: Activate the records
Section titled “Step 4: Activate the records”- Open Custom Metadata Types → Record Health Check Set → Manage Records, select Edit next to Account Readiness, select Active, and save.
- Open Custom Metadata Types → Record Health Check → Manage Records, select Edit next to Billing City Is Populated, select Active, and save.
Step 5: Add the card to the Account record page
Section titled “Step 5: Add the card to the Account record page”- Open an Account record.
- Select the gear icon, then select Edit Page. Lightning App Builder opens.
- In the Components panel, search for
Record Health Check, and drag the component onto the page. - In the component properties, set Check Set to Account Readiness (Account_Readiness). The list shows each Check Set’s label followed by its API name.
- Select Save.
- If Salesforce asks you to activate the page, select Activate, and assign it as the default for the app, record types, and profiles that your test user uses. If the page is already active for those users, no activation is needed.
- Select the back arrow to return to the Account, and refresh the browser.
Result: The card shows the title Account Readiness and a Run button.
If Account Readiness is not in the Check Set list, confirm that the Check Set is active and
that its Object is Account. The list shows only active Check Sets for the page’s object.
Step 6: Test both results
Section titled “Step 6: Test both results”Log in as the test user, or ask that user to run these tests on an Account they can edit.
| Test | Steps | Expected result on the card |
|---|---|---|
| Fail | Clear Billing City, save the Account, then select Run. | The row shows Warning, the message “[Account Name] is missing a Billing City.”, the Edit Account link, and the fix message. The summary shows 1 Warning. |
| Pass | Enter a Billing City and save the Account. | The card runs again by itself after the save, because it has already completed a run. The row shows Pass, and the summary shows 1 Passed. Select Rerun if the result does not change. |
During the fail test, select Edit Account and confirm that it opens the edit page for the same Account. Restore the Account’s original Billing City when you finish.
When you test as an administrator assigned Record Health Check Admin, the failed row also shows
Expected with the formula NOT(ISBLANK(BillingCity)). Users without diagnostic access do not see
the formula. To show Found and Expected values to every user, add Display: Found Formula and
Display: Expected Formula to the Check.
Resolve common problems
Section titled “Resolve common problems”| What you see | What to do |
|---|---|
| The card is not on the page | Open Edit Page → Activation and confirm the page is assigned to the test user’s app, record type, and profile. |
| Account Readiness is not in the picker | Confirm the Check Set is active and Object is exactly Account. |
| The card says it doesn’t contain any active Checks | Confirm the Check is active and its Check Set is Account Readiness. |
| The row shows Unable to Check | Confirm the running user can read the Account and the Billing City field. |
| The card says you don’t have access to view or run Record Health Check | Assign Record Health Check Card User to the running user. |
| A Setup change does not appear | Select Run or Rerun. Each run reads the configuration again, so you do not need to reload the page. |