Skip to content

Examples you can copy

Detailed page. Use “On this page” to jump directly to the section you need.

Choose an Evaluation Type and a complete example that matches the Salesforce requirement you want to check.

Use these examples to build a health check for a Salesforce record. Each example starts with a business question, explains which Evaluation Type fits, lists the Setup values, and shows how to test the result.

Examples change only when a release capability improves the business story they teach. Runtime fixes, deliberately invalid configurations, and specialized API/security behavior use the existing example, an integration-only fixture, or a focused walkthrough instead of being added to every Check. See Example coverage for the current decisions and verification data.

You do not need to read every page. Choose the row closest to your requirement, create a Check from the example values, and replace its fields, limits, and messages with values approved for your org.

The pages in this library are instructions, not metadata installed in your org. The installed package includes four Check Set records and 50 Check records whose names begin with rhc__Example_. Other examples exist only in these documentation pages unless an administrator creates them.

Unless a page states otherwise, its Check Set shows a Run button with the utility:play icon and changes the button label to Rerun after the first run. The configuration tables give the exact field values.

Not installed yet? Finish Install and verify first, then return here. Use an example Check Set included with the installed package for the first sandbox test. Create a new Check Set for your org before adapting a documentation example.

Start with where Salesforce stores the information needed to decide whether the record passes.

What do you need to check?UseGood first example
Fields on the current record or a parent recordVerify with a formulaSeller research readiness
Related records, such as Contacts, Opportunities, or CasesVerify with a queryCustomer handoff
Whether the results of two queries match or overlapCompare two queriesOpportunity Contact Role coverage
A decision that requires custom codeVerify with ApexRecent Account activity

Start with a formula when possible. Move to a query when the answer depends on related records. Use Apex only when the other Evaluation Types cannot express the business decision clearly.

  1. Open an example that resembles your business requirement.
  2. Read Why use this Evaluation Type to confirm why the example uses Formula, Query, Compare Two Queries, or Apex.
  3. Create the Check Set first when the example requires a new one. In Setup, go to Custom Metadata Types → Record Health Check Set → Manage Records.
  4. Create the Check. In Setup, go to Custom Metadata Types → Record Health Check → Manage Records and copy the values from Configure the Check.
  5. Replace the sample fields, limits, and messages with values that match your org’s requirement.
  6. Add the Record Health Check component to the correct Lightning record page if it is not already present. Select the Check Set, save, and activate the page as Org Default, App Default, or for the intended app, record type, and profiles.
  7. Assign Record Health Check Card User to the test user and confirm that the Check Set Object matches the Lightning record page object.
  8. Follow Test the Check and confirm the documented passing, failing, skipped, or error results that apply before making the Check available to users.

utility:play is a standard Lightning icon name that you paste into Run Button Icon; it is not a file upload. Tables can show API values such as ALL_ROWS_PASS beside their Setup labels so developers can identify metadata, but administrators should select the visible Setup label.

The technical reference lists every setting, operator, limit, and result rule. Use an example when creating a Check. Use the reference when the example does not cover a setting you need.

Evaluation TypeStart withDetailed reference
Verify with a formulaSeller research readinessFormula reference
Verify with a queryCustomer handoffQuery reference
Compare two queriesOpportunity Contact Role coverageCompare two queries reference
Verify with ApexRecent Account activityApex reference

Choose Verify with a formula when the Check can read everything it needs from the current record or a parent relationship. A formula is usually the simplest option and does not require Apex.

ExampleWhat it checksWhat you will learn
Seller research readinessAn Account has a Phone or WebsiteAllow either of two fields to satisfy a Check
Billing address reviewRequired billing-address fields are populatedRequire several fields together
Partner regional assignmentPartner Accounts have regional-assignment informationRun a Check only for matching records
Branch handoffA branch has the headquarters information needed for handoffRead a parent record and link users to it
Small-business program eligibilityEmployee count meets a program limitCompare a number and explain the found and expected values

Choose Verify with a query when the answer depends on related Salesforce records. One query can return a count, a field value, or a list for the Check to evaluate.

ExampleWhat it checksWhat you will learn
Customer handoffAn Account has at least one ContactCompare a related-record count with a minimum
Pipeline next stepsEvery open Opportunity has a Next StepRequire every returned record to pass
Meaningful pipelineAt least one open Opportunity meets an Account-specific amountCompare query results with a value from the current record
Forecast amountsEvery open Opportunity has an Amount greater than zeroEvaluate numbers and handle empty values
Placeholder email cleanupContact emails do not use a placeholder domainCheck text returned by a query
Account Owner team membershipThe Account Owner is also an Account Team memberFind a current-record value in a related-record list
Case review capacityThe high-priority Case backlog stays within a limitCompare a related-record count with a maximum

Choose Compare two queries when both sides of the decision come from related records. The Check can compare two counts or determine whether two lists match, contain the same values, or overlap.

ExampleWhat it checksWhat you will learn
Opportunity Contact Role coverageEvery open Opportunity has a Contact RoleCompare two related-record counts
Open-pipeline product continuityOpen pipeline includes a previously purchased ProductCheck whether two lists share a value
Account Team coverageThe Account Team includes every open Opportunity OwnerCheck whether one list contains every value from another list

Choose Verify with Apex when the Check needs calculations, several steps, or Salesforce behavior that the other Evaluation Types cannot express clearly. Apex examples require development and test coverage before deployment.

AccountHasRecentActivityCheck is included in the namespaced unlocked package. The strategic-readiness and open-opportunity classes are source-development recipes unless your team reviews, tests, and deploys them.

ExampleWhat it checksWhat you will learn
Recent Account activityAn Account meets a recent WhatId Task/Event cadenceExercise typed parameters, per-record recovery, evidence, display overrides, and inline links with positive and negative data
Open Opportunity healthAn open Opportunity does not have several warning signs at onceApply several conditions to the same related record
Strategic Account readinessA Strategic Account meets a weighted readiness scoreCalculate and explain a configurable score

Each example teaches a different Record Health Check feature. Examples can use the same Salesforce object without repeating the same configuration pattern.

ExampleFeature demonstrated
Seller research readinessFormula OR, optional alternatives, and an edit action
Billing address reviewFormula AND with display-only Found and Expected formulas
Partner regional assignmentFormula applicability, SKIPPED, and count-only display for passed Checks
Branch handoffParent relationship fields and a parent-record action URL
Small-business program eligibilityNumeric Formula comparison with Found/Expected visible on every result
Customer handoffAggregate COUNT() compared with a fixed minimum
Pipeline next stepsALL_ROWS_PASS, Is not empty, no-row SKIPPED, and empty-field failure
Meaningful pipelineANY_ROW_PASSES compared with an Account formula and formula applicability
Forecast amountsNumeric ALL_ROWS_PASS with result-summary merge tokens
Placeholder email cleanupText exclusion, ignored blank fields, and a prerequisite Check
Account Owner team membershipQuery list-membership mode using a record formula and Comparison Query
Case review capacityAggregate upper limit plus optional Check Result and Check Set Run lifecycle events
Opportunity Contact Role coverageAggregate alias, two-query equality, and count-query applicability
Open-pipeline product continuityTwo lists compared with Lists overlap
Account Team coverageTwo lists compared with Lists contain all and no-row failure
Recent Account activityApex across Task and Event with a limited date range configured in JSON
Open Opportunity healthApex applying several conditions to each related record plus count-query applicability
Strategic Account readinessWeighted Apex score, multiple JSON parameters, and formula applicability

The reference pages document additional operators and limits that do not need separate examples.