Score a customer Account's readiness
Create a Record Health Check that scores a customer Account from 0 to 100 on four signals, Contacts,
open pipeline, recent activity, and a complete billing address, and passes when the score meets a
minimum you set. The example uses the Verify with Apex Evaluation Type with a custom Apex class,
AccountStrategicReadinessCheck, that a developer creates and deploys.
This Apex class does not install with Record Health Check. A developer must create, test, and deploy it from Strategic readiness: Apex implementation before you configure the Check. Without the class, the Check shows Unable to Check.
How the score works
Section titled “How the score works”The class adds 25 points for each signal that is true for the Account:
| Signal | Adds 25 points when |
|---|---|
| Contacts | The Account has at least one Contact. |
| Open pipeline | The total Amount of the Account’s open Opportunities is greater than 0. |
| Recent activity | A closed Task, or an Event, related to the Account is dated within the last activityDaysBack days. |
| Billing address | Billing Street, Billing City, and Billing Country are all populated. |
The score is always 0, 25, 50, 75, or 100. The Check passes when the score is at least minScore.
This example uses a minimum of 75, so an Account passes with any three of the four signals.
| Parameter | Meaning | Allowed values | Value if missing or not valid |
|---|---|---|---|
minScore | The lowest passing score | 1 to 100 | 80 |
activityDaysBack | How many days back the activity window starts | 1 to 3,650 | 30 |
The class uses the fallback value silently when a parameter is missing or out of range, so always enter the values you intend.
Why Apex fits
Section titled “Why Apex fits”The result combines four signals from four objects into one score. Four separate Checks would show four pass or fail results, which is better when every signal is required. Use this pattern when one combined score is what the business reviews.
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.
- Confirm that the
AccountStrategicReadinessCheckclass is deployed: in Setup, open Apex Classes and find it. - Decide which Accounts are scored. This example scores Accounts whose Type is Customer - Direct, a standard value. Change Applies When (Formula) to match how your org identifies the Accounts to score.
- Confirm that the people who will use the card can read Contacts, Opportunities, Tasks, Events, and the Account billing fields.
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 Apex Readiness |
| Object | Account |
| Record Health Check Set Name | Account_ |
| Active | Cleared until validation succeeds |
| Card Title | Account Readiness |
| Card Subtitle | Confirm recent engagement and pipeline readiness. |
| When Checks Run | When the user clicks Run |
| Found/Expected Display | Show on demand |
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 | Customer Account Readiness Score |
| Check Set | Account Apex Readiness |
| Evaluation Type | Verify with Apex |
| Record Health Check Name | Customer_ |
| Evaluation Order | 30 |
| Active | Cleared until validation succeeds |
| Apex Class | AccountStrategicReadinessCheck |
| Apex Parameters (JSON) | {"minScore": 75, "activityDaysBack": 60} |
| Check Title | Customer Account readiness score meets the minimum |
| Check Description | Scores Contacts, open pipeline, activity in the last 60 days, and billing address, 25 points each. Passes at 75 or more. |
| Message When Failed | {!record. |
| Fix Message | Check which signals are missing: Contacts, open pipeline Amount, activity in the last 60 days, and a complete billing address. |
| Message When Unable To Evaluate | Unable to calculate the readiness score. |
| Failure Severity | Warning |
| Applies To | When a formula is true |
| Applies When (Formula) | ISPICKVAL(Type, "Customer - Direct") |
| Message When Not Applicable | {!record. |
This Check has no Action URL, because one link cannot cover all four signals. Add one only if your org has a report or page that shows them together.
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 the Check, then the Check Set.
- Add the Record Health Check component to the Account record page, select Account Apex Readiness (Account_Apex_Readiness), 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”Use a sandbox Account with Type set to Customer - Direct. Select Run on the card for each case.
| Signals that are true | Score | Result on the card |
|---|---|---|
| None | 0 | Warning |
| Contacts only | 25 | Warning |
| Contacts, open pipeline, and billing address | 75 | Pass |
| All four | 100 | Pass |
| Any, on an Account whose Type is not Customer - Direct | None | Skipped |
An open Opportunity with a blank Amount adds nothing to open pipeline. Run one case as a user whom sharing prevents from seeing the Account’s Contacts; that user’s score is 25 points lower, because the Check scores only what the user can see. A user with no read access to the Contact object at all gets System Error instead, because the class’s query fails.
What users see
Section titled “What users see”A failed row shows Warning, the message with the score, and the fix message. Found shows the
score, and Expected shows the minimum, 75, without the “at least” wording a Query Check adds. The card does not show which signals were missing; the fix
message lists them so the user can review each one.
Resolve problems
Section titled “Resolve problems”| What you see | What to check |
|---|---|
| Every Account shows Skipped | The Account’s Type matches the value in Applies When (Formula) exactly. |
| The score is lower than expected | Each signal, including blank Opportunity Amounts, the activity window, and the user’s access. |
| The minimum seems wrong | Apex Parameters (JSON) is valid. A missing or out-of-range minScore silently becomes 80. |
| Unable to Check with the class not found | The class is deployed, and Apex Class is exactly AccountStrategicReadinessCheck. |