Skip to content
Suggest a correction

Score a customer Account's readiness

Example6 min read

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.

The class adds 25 points for each signal that is true for the Account:

SignalAdds 25 points when
ContactsThe Account has at least one Contact.
Open pipelineThe total Amount of the Account’s open Opportunities is greater than 0.
Recent activityA closed Task, or an Event, related to the Account is dated within the last activityDaysBack days.
Billing addressBilling 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.

ParameterMeaningAllowed valuesValue if missing or not valid
minScoreThe lowest passing score1 to 10080
activityDaysBackHow many days back the activity window starts1 to 3,65030

The class uses the fallback value silently when a parameter is missing or out of range, so always enter the values you intend.

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.

  • Install Record Health Check, and assign yourself Record Health Check Admin and the Salesforce Customize Application permission.
  • Confirm that the AccountStrategicReadinessCheck class 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.

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 Apex Readiness
ObjectAccount
Record Health Check Set NameAccount_Apex_Readiness
ActiveCleared until validation succeeds
Card TitleAccount Readiness
Card SubtitleConfirm recent engagement and pipeline readiness.
When Checks RunWhen the user clicks Run
Found/Expected DisplayShow on demand

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

FieldValue
LabelCustomer Account Readiness Score
Check SetAccount Apex Readiness
Evaluation TypeVerify with Apex
Record Health Check NameCustomer_Account_Readiness_Score
Evaluation Order30
ActiveCleared until validation succeeds
Apex ClassAccountStrategicReadinessCheck
Apex Parameters (JSON){"minScore": 75, "activityDaysBack": 60}
Check TitleCustomer Account readiness score meets the minimum
Check DescriptionScores Contacts, open pipeline, activity in the last 60 days, and billing address, 25 points each. Passes at 75 or more.
Message When Failed{!record.Name fallback="This Account"} scored {!rhcResult.foundValue} out of 100, below the minimum of 75.
Fix MessageCheck which signals are missing: Contacts, open pipeline Amount, activity in the last 60 days, and a complete billing address.
Message When Unable To EvaluateUnable to calculate the readiness score. Confirm that you can read the Account's related records.
Failure SeverityWarning
Applies ToWhen a formula is true
Applies When (Formula)ISPICKVAL(Type, "Customer - Direct")
Message When Not Applicable{!record.Name fallback="This Account"} is not a direct customer, so it is not scored.

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.

  1. Run the Validate Record Health Check Configuration Flow action, as described in Validate configuration before activation, and correct every error.
  2. Activate the Check, then the Check Set.
  3. Add the Record Health Check component to the Account record page, select Account Apex Readiness (Account_Apex_Readiness), and activate the page.
  4. Assign Record Health Check Card User to the users who test the card.

Use a sandbox Account with Type set to Customer - Direct. Select Run on the card for each case.

Signals that are trueScoreResult on the card
None0Warning
Contacts only25Warning
Contacts, open pipeline, and billing address75Pass
All four100Pass
Any, on an Account whose Type is not Customer - DirectNoneSkipped

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.

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.

What you seeWhat to check
Every Account shows SkippedThe Account’s Type matches the value in Applies When (Formula) exactly.
The score is lower than expectedEach signal, including blank Opportunity Amounts, the activity window, and the user’s access.
The minimum seems wrongApex Parameters (JSON) is valid. A missing or out-of-range minScore silently becomes 80.
Unable to Check with the class not foundThe class is deployed, and Apex Class is exactly AccountStrategicReadinessCheck.