Install the demo in a scratch org
Create a disposable Salesforce scratch org with the latest Record Health Check release, prepared sample records, and a card already on the Account record page. Every example Check has a known result in the demo data, so you can compare what the card shows with the expected results on this page.
The demo runs from the Record Health Check source repository and uses the Salesforce CLI. To try the package in an existing sandbox instead, follow Install Record Health Check in a sandbox.
Before you start
Section titled “Before you start”You need:
- Git, to copy the repository.
- Node.js 22 with npm.
- The Salesforce CLI (
sf). The repository’s toolchain file lists the CLI version that the demo was verified with. - A Dev Hub: a Salesforce org that is allowed to create scratch orgs. In the Dev Hub, an administrator enables it in Setup → Dev Hub. A Developer Edition org can be a Dev Hub.
- A CLI alias for the Dev Hub. An alias is a short name the CLI uses for an org. To create one, run
sf org login web --set-default-dev-hub --alias my-dev-huband sign in to the Dev Hub.
The demo uses one scratch org from the Dev Hub’s daily and active scratch org allocations. On Windows, run the commands in PowerShell, Command Prompt, or Git Bash.
Step 1: Create the demo org
Section titled “Step 1: Create the demo org”-
Copy the repository and install its tools:
Terminal window git clone https://github.com/gkolan/record-health-check.gitcd record-health-checknpm ci -
Create the demo org, replacing
my-dev-hubwith your Dev Hub alias:Terminal window npm run setup -- --dev-hub my-dev-hub --alias rhc-demo--aliasnames the new scratch org. The command stops without changes if an org already uses that alias. Add--duration-dayswith a value from 1 to 7 to choose how long the org lasts; the default is 7.
The command takes several minutes. It:
- creates a scratch org without a namespace;
- installs the latest released Record Health Check package with Install for Admins Only;
- assigns Record Health Check Card User to you;
- deploys demo list views, a demo Account record page that shows the Example: Account Check Builder Guide card, and several test Check Sets, Apex classes, and triggers that the repository’s smoke tests use;
- creates the sample records, then checks that every example Check returns its expected result; and
- runs the repository’s subscriber smoke tests.
Result: The command ends with “Subscriber demo org is ready.” and prints the command to open the org.
If the command fails, read the last step it printed. If it failed after creating the scratch org and you do not need that org, delete it and run the command again with the same alias:
sf org delete scratch --target-org rhc-demo --no-promptDeleting a scratch org cannot be undone. Confirm the alias first.
Step 2: Open the demo Accounts
Section titled “Step 2: Open the demo Accounts”sf org open --target-org rhc-demo --path "lightning/o/Account/list?filterName=RHC_Demo_Accounts"- Open Acme Corporation. The Account page already has the Example: Account Check Builder Guide card.
- Select Run.
- Compare the summary with the expected result: 7 Passed, 5 Failed, 9 Warnings, 3 Info, and 1 Unable. The 17 Checks that do not pass appear as Failed, Warning, or Info according to their Failure Severity.
To try Example: Account Relationship & Risk on the same page, select the gear icon, then Edit Page, select the card, and change its Check Set property. Or drag a second Record Health Check component onto the page and select that Check Set for it. Save the page, return to Acme, and select Run.
The demo deploys extra Account Check Sets for its smoke tests, so the Account Check Set list contains more than the two examples. Choose the example by its label.
Step 3: Add the card to Contact and Opportunity pages
Section titled “Step 3: Add the card to Contact and Opportunity pages”The setup command adds the card only to the Account page.
- Open the RHC Demo Contacts list view, and open Elena Hart (RHC Demo).
- Select the gear icon, then Edit Page.
- Search for
Record Health Checkin the Components panel, and drag the component onto the page. Because Example: Contact Relationship Readiness is the only active Contact Check Set, Lightning App Builder selects it automatically. Confirm the selection. - Select Save, then Activate, and assign the page as the Org Default.
- Return to Elena Hart. The card runs when the page opens.
- Repeat these steps for RHC Demo Ready Deal from the RHC Demo Opportunities list view. The Example: Opportunity Deal Readiness Check Set is selected automatically.
Expected results
Section titled “Expected results”Each row counts the results for one record. Fail includes every Failed, Warning, and Info row. The setup command verifies all 204 of these results when it creates the data.
| Check Set | Record | Pass | Fail | Skipped | Unable |
|---|---|---|---|---|---|
| Example: Account Check Builder Guide | Acme Corporation | 7 | 17 | 0 | 1 |
| Example: Account Check Builder Guide | RHC Builder Ready Account | 22 | 0 | 3 | 0 |
| Example: Account Check Builder Guide | RHC Builder Needs Review Account | 3 | 22 | 0 | 0 |
| Example: Account Check Builder Guide | RHC Builder Empty Account | 9 | 3 | 13 | 0 |
| Example: Account Relationship & Risk | Acme Corporation | 3 | 4 | 1 | 0 |
| Example: Account Relationship & Risk | RHC Demo Ready Account | 8 | 0 | 0 | 0 |
| Example: Account Relationship & Risk | RHC Demo Review Account | 0 | 8 | 0 | 0 |
| Example: Account Relationship & Risk | RHC Builder Empty Account | 2 | 3 | 3 | 0 |
| Example: Contact Relationship Readiness | Elena Hart (RHC Demo) | 8 | 0 | 0 | 0 |
| Example: Contact Relationship Readiness | Marcus Shaw (RHC Demo) | 7 | 1 | 0 | 0 |
| Example: Contact Relationship Readiness | Morgan Vale (RHC Demo) | 0 | 8 | 0 | 0 |
| Example: Contact Relationship Readiness | Riley Chen (RHC Demo) | 6 | 2 | 0 | 0 |
| Example: Opportunity Deal Readiness | RHC Demo Ready Deal | 8 | 0 | 0 | 0 |
| Example: Opportunity Deal Readiness | RHC Demo Review Deal | 0 | 8 | 0 | 0 |
| Example: Opportunity Deal Readiness | RHC Demo Closed Won | 6 | 0 | 2 | 0 |
| Example: Opportunity Deal Readiness | RHC Demo Closed Lost | 6 | 0 | 2 | 0 |
| Example: Opportunity Deal Readiness | RHC Demo Low Pipeline | 5 | 3 | 0 | 0 |
Why some results are not Pass or Fail:
- On Acme, Total proposal Amount matches total Product value is Unable to Check on purpose: Acme’s proposal has no Opportunity Products, so there is no Product total to compare.
- On Acme, Channel partner governance is complete is Skipped because Acme’s Type is
Customer, and the Check applies only to channel customers. - On the closed Opportunities, the primary-Contact and recent-activity Checks are Skipped because they apply only to open Opportunities.
Example: Account Check Builder Guide on Acme Corporation
Section titled “Example: Account Check Builder Guide on Acme Corporation”| Order | Check | Result | Why |
|---|---|---|---|
| 10 | Account Type is set | Pass | Acme’s Type is Customer. |
| 20 | Account has a phone number or website | Pass | Acme has a Phone and a Website. |
| 30 | Billing address matches the parent bill-to account | Pass | Acme’s billing address matches its parent Account’s. |
| 40 | High-priority open Cases stay within the limit | Failed | Acme has 4 open High-priority Cases; the limit is 1. |
| 50 | At least one open Opportunity is Commit | Info | No open Opportunity is in the Commit forecast category. |
| 60 | Every open Case has a Contact | Failed | 6 of the 12 open Cases have no Contact. |
| 70 | Every escalated open Case has a Description | Warning | The escalated open Case has no Description. |
| 80 | Every open Opportunity has an active owner | Pass | Both open Opportunities have active owners. |
| 90 | No proposal has a missing or low Amount | Pass | The proposal’s Amount is $600,000, above the $25,000 minimum. |
| 100 | Open Opportunities include a Decision Maker | Pass | One Decision Maker Contact Role is on an open Opportunity. |
| 110 | Contacts on open deals have Email or Phone | Warning | One Contact Role’s Contact has neither Email nor Phone. |
| 120 | Open-deal Contact Roles include Technical Buyer | Info | No open-deal Contact Role is Technical Buyer. |
| 130 | Cases closed keep pace with Cases created | Warning | 4 Cases closed and 16 were created in the last 30 days. |
| 140 | Every won Opportunity has an Amount | Warning | The won Opportunity has no Amount. |
| 150 | Every proposal has a Next Step | Warning | The proposal has no Next Step. |
| 160 | Every proposal has a Primary Campaign Source | Failed | The proposal has no Primary Campaign Source. |
| 170 | Open Opportunity Close Dates are in range | Info | Only 1 of the 2 open Opportunities closes within the next 180 days. |
| 180 | Every open Opportunity has a Contact Role | Failed | Only 1 of the 2 open Opportunities has a Contact Role. |
| 190 | Every won Opportunity has a primary Contact | Warning | The won Opportunity has no primary Contact Role. |
| 200 | New pipeline value covers recently lost value | Failed | New open pipeline is $600,000; value lost in the last 90 days is $760,000. |
| 210 | Total proposal Amount matches total Product value | Unable to Check | The proposal has no Opportunity Products to total. |
| 220 | Sales and service share a Contact name | Warning | No Contact on an open Case is also a Contact Role on an open Opportunity. |
| 230 | Sales Contact names cover priority Case Contacts | Warning | The Contacts on High-priority Cases are not Contact Roles on open Opportunities. |
| 240 | Open Opportunity names match those with Products | Warning | Neither open Opportunity has Products, so the two name lists do not match. |
| 250 | Account activity meets the 60-day cadence | Pass | Two Tasks were completed on Acme in the last 60 days, which meets the minimum of two. |
These Checks have no categories, so the card shows one summary. Account Check Builder Guide: configuration and results shows the configuration of every Check.
What the demo data contains
Section titled “What the demo data contains”The data scripts create 8 Accounts, 51 Contacts, 19 Opportunities, 12 Opportunity Contact Roles, 6 Tasks, 20 Cases, 1 Campaign, 1 Product with a standard Price Book Entry, and 4 Opportunity Products. They also create a user named Jordan Blake, make Jordan the owner of Acme Corporation, and then deactivate Jordan, so that the owner Checks show an inactive owner. No Events are created.
Dates are relative to the day the scripts run, so calendar dates differ between runs while the results stay the same. The data uses one currency.
| Record | What it demonstrates |
|---|---|
| Acme Corporation | An Account with many gaps: 38 Contacts, 6 without email, 16 Cases, two open Opportunities, and an inactive owner |
| RHC Builder Ready Account | Every applicable Builder Guide Check passes |
| RHC Builder Needs Review Account | Most Builder Guide Checks fail |
| RHC Builder Empty Account | An Account with no related records, which shows which Checks skip when there is nothing to check |
| RHC Demo Ready Account | Every Account Relationship & Risk Check passes |
| RHC Demo Review Account | Every Account Relationship & Risk Check fails |
| Elena Hart (RHC Demo) | Every Contact Check passes |
| Marcus Shaw (RHC Demo) | Only the recent-Task Check fails |
| Morgan Vale (RHC Demo) | Every Contact Check fails |
| Riley Chen (RHC Demo) | The bounced-email and recent-Task Checks fail, while Contact has Email or Phone passes |
| RHC Demo Ready Deal | Every Opportunity Check passes |
| RHC Demo Review Deal | Every Opportunity Check fails |
| RHC Demo Closed Won and Closed Lost | Open-deal Checks skip on closed Opportunities |
| RHC Demo Low Pipeline | An Opportunity with three gaps |
Verify the demo again
Section titled “Verify the demo again”To check the data and results again without changing anything, run the verification scripts from the repository folder:
sf apex run --target-org rhc-demo --file scripts/subscriber/data/verifyDemo.apexsf apex run --target-org rhc-demo --file scripts/subscriber/data/verifyReadinessData.apexEach script ends without an assertion error when the data and results match.
Test diagnostics as a user who is not an administrator
Section titled “Test diagnostics as a user who is not an administrator”The demo assigns Record Health Check Card User to you, but a scratch org administrator can read everything. To see what a user with limited access sees, create a second user with access to the demo records, and assign Record Health Check Card User to that user.
To see diagnostic details as that user:
- Assign Record Health Check Diagnostics Viewer to the user directly, not through a Permission Set Group.
- In Setup → Custom Metadata Types → Record Health Check Set → Manage Records, edit the example Check Set and select Show Diagnostics.
- Open a record as the user and run the card.
- When you finish, clear Show Diagnostics and remove the Diagnostics Viewer assignment.
Delete the demo org
Section titled “Delete the demo org”A scratch org expires at the end of its duration and its data is then deleted. To delete it sooner:
sf org delete scratch --target-org rhc-demo --no-prompt