Check fields
Look up every field of a Record Health Check (a Check) by its Setup label or API name: when to use it, what to enter, and what happens when the Check runs.
| Setup value | Name |
|---|---|
| Custom Metadata Type label | Record Health Check |
| Custom Metadata Type API name | Record_ |
Create or review a Check in Setup → Custom Metadata Types → Record Health Check → Manage Records. Start with the decision tables below. Open an individual field only when that field applies to the Evaluation Type you chose.
A Verify with a formula Check needs only the identity and message fields plus Pass Condition; skip the query and Apex sections. Query Checks contain SOQL, so review each query before activation. Verify with Apex needs an Apex class that is written, tested, and deployed like any other Apex code.
Build a Check in the order it runs
Section titled “Build a Check in the order it runs”| Stage | Decision | Start with |
|---|---|---|
| 1. Place the Check | Which Check Set owns it, when does it run, and is it active? | Check Set, Evaluation Order, and Active |
| 2. Decide whether it applies | Does it run for every record, only when a formula or query matches, or only after another Check passes? | Applies To and Prerequisite Check |
| 3. Choose how it evaluates | Can Salesforce formula or SOQL express the check, or is Apex required? | Evaluation Type |
| 4. Define the decision | What value is found, what is expected, and how are they compared? | The Evaluation Type table below |
| 5. Explain the result | What should someone understand and do after a failure or an unable result? | Check Title, Message When Failed, and Fix Message |
| 6. Add a next action | Would a safe same-org destination help resolve the result? | Action Label and Action URL |
| 7. Publish when needed | Does another process need the finalized Check outcome? | Publish User Result Event |
| What the Check must verify | Evaluation Type | Start with |
|---|---|---|
| Fields on the current Salesforce record | Verify with a formula (FORMULA) | Pass Condition |
| Records or an aggregate returned by one SOQL query | Verify with a query (QUERY) | Source Query and Comparison Operator |
| One SOQL result against another SOQL result | Compare two queries (COMPARE_) | Source Query and Comparison Query |
| Logic implemented in a package or org Apex class | Verify with Apex (APEX) | Apex Class |
For complete configurations, choose an example by Evaluation Type. For text
that adapts to the record and result, use merge tokens:
record.*, rhcResult.*, rhcRun.*, rhcCheck.*, rhcSet.*, and rhcQuery.*.
Prerequisite Check stores the prerequisite’s Record Health Check Name (Developer Name) within the
same Check Set, not its card title. Publish User Result Event applies only when a person selects
Run or Rerun on the card; Flow and Apex choose their own publication. The action link
appears only on a FAIL row, never on System Error or Unable to Check rows.
Field index
Section titled “Field index”| Setup label | API name | Group |
|---|---|---|
| Record Health Check Name | DeveloperName | Identity and execution |
| Label | MasterLabel | Identity and execution |
| Check Set | Record_ | Identity and execution |
| Evaluation Order | EvaluationOrder_ | Identity and presentation |
| Active | IsActive_ | Identity and execution |
| Check Title | CheckTitle_ | What users see |
| Check Description | CheckDescription_ | What users see |
| Category | Category_ | What users see |
| Failure Severity | FailureSeverity_ | What users see |
| Message When Failed | FailureMessage_ | What users see |
| Message When Unable To Evaluate | UnableToEvaluateMessage_ | What users see |
| Fix Message | FixMessage_ | What users see |
| Action Label | ActionLabel_ | What users see |
| Action URL | ActionUrl_ | What users see |
| Evaluation Type | EvaluationType_ | Check type and value display |
| Display: Value Format | DisplayValueFormat_ | Check type and value display |
| Show Found and Expected | ComparisonDisplayMode_ | Check type and value display |
| Pass Condition | PassConditionFormula_ | Check fields on this record (FORMULA) |
| Display: Found Formula | DisplayFoundFormula_ | Optional result display |
| Display: Expected Formula | DisplayExpectedFormula_ | Optional result display |
| Formula Result Type | FormulaResultType_ | Query comparison formulas |
| Source Query | SourceQuery_ | Query sources (QUERY / COMPARE_) |
| Source Query Field | SourceQueryField_ | Query sources (QUERY / COMPARE_) |
| Comparison Query | ComparisonQuery_ | Query sources (QUERY / COMPARE_) |
| Comparison Query Field | ComparisonQueryField_ | Query sources (QUERY / COMPARE_) |
| Value to find in the list (formula) | FindInListFormula_ | Query sources (QUERY / COMPARE_) |
| Comparison Operator | ComparisonOperator_ | Query comparison |
| Expected Value Comes From | ExpectedValueSource_ | Query comparison |
| Expected Value (Fixed) | ExpectedFixedValue_ | Query comparison |
| Expected Currency ISO Code | ExpectedCurrencyIsoCode_ | Query comparison |
| Expected Value (Formula) | ExpectedRecordFormula_ | Query comparison |
| How To Read Query Results | QueryResultHandling_ | Advanced query behavior |
| If Query Finds No Records | NoRowsResult_ | Advanced query behavior |
| If Field Value Is Empty | EmptyValueHandling_ | Advanced query behavior |
| Max Query Rows (1-2000) | MaxQueryRows_ | Advanced query behavior |
| Display: Found Text | DisplayFoundText_ | Advanced display text |
| Display: Expected Text | DisplayExpectedText_ | Advanced display text |
| Applies To | ApplicabilityMode_ | When this check applies |
| Applies When (Formula) | ApplicabilityFormula_ | When this check applies |
| Applies When (Count Query) | ApplicabilityCountQuery_ | When this check applies |
| Message When Not Applicable | ApplicabilityNotMetMessage_ | Friendly explanation for a skipped check |
| Count Must Be | ApplicabilityCountOperator_ | When this check applies |
| Count Value | ApplicabilityCountThreshold_ | When this check applies |
| Prerequisite Check | PrerequisiteCheck_ | When this check applies |
| Apex Class | ApexClass_ | Custom Apex (APEX) |
| Apex Parameters (JSON) | ApexParametersJson_ | Custom Apex (APEX) |
| Publish User Result Event | PublishUserResultEvent_ | Lifecycle events |
1. Identity and execution
Section titled “1. Identity and execution”Record Health Check Name (DeveloperName )
Section titled “Record Health Check Name (DeveloperName)”Required Text(40). Setup labels this field Record Health Check Name; it is the record’s Developer
Name, the stable name Salesforce uses for the Custom Metadata record. A
prerequisite Check refers to this value, not the Check Title shown on the card. Example:
Account_Pipeline_Readiness.
Flow and Apex identify a Check by its Qualified API Name. For a Check created in your org it is
the same as this name, such as Account_Pipeline_Readiness. For a Check included with the installed
package it adds the namespace, such as rhc__Example_Guide_Recent_Activity. See
Find the Qualified API Name,
and do not add or remove rhc__ yourself.
Label (MasterLabel )
Section titled “Label (MasterLabel)”Required, up to 40 characters. This identifies the Custom Metadata record in Setup. It is not the title users
see on the card; configure that in Check Title. Example: Account pipeline readiness.
Check Set (Record_Health_Check_Set__c )
Section titled “Check Set (Record_Health_Check_Set__c)”Required Metadata Relationship. Select the Check Set that owns this Check. Each Check belongs to one Check Set, and that Check Set determines the Salesforce object and card behavior.
For example, select your Account_Readiness Check Set for a Check that evaluates Account records.
Evaluation Order (EvaluationOrder__c )
Section titled “Evaluation Order (EvaluationOrder__c)”Optional Number(4,0). The default is 100. Checks with lower numbers run and appear first. When
two Checks have the same number, Record Health Check orders them by Developer Name. Prerequisite
references, not this field, determine dependency scheduling.
Use values such as 10, 20, and 30 so a new Check can be inserted later. Evaluation Order is
presentation order. Prerequisites are scheduled from their dependency references even when they
appear later.
Active (IsActive__c )
Section titled “Active (IsActive__c)”Checkbox, selected by default. Clear it to stop this Check from running without deleting its Custom Metadata record. Other active Checks in the Check Set continue to run.
2. What users see
Section titled “2. What users see”Check Title (CheckTitle__c )
Section titled “Check Title (CheckTitle__c)”Required Text(255). This is the title users see for the Check on the card. Use a short statement
that makes the requirement obvious, such as Billing City is present or Account has an active Contact. This is separate from Label and Developer Name, which identify the record in Setup.
Check Description (CheckDescription__c )
Section titled “Check Description (CheckDescription__c)”Optional Text(255). This additional explanation appears when a user hovers over the Check Title or
moves keyboard focus to it. Explain what is checked and why it matters. It does not appear inline in
the row. Example: Checks open Opportunity count and pipeline amount.
Category (Category__c )
Section titled “Category (Category__c)”Optional restricted picklist. Category classifies the business purpose of a Check. It does not change the result, severity, or evaluation order. When any Check in the run has a category, the card replaces the single overall totals bar with one summary per category, in alphabetical order, and groups Checks without a category under Other. The Check Set’s Summary Display setting places those summaries above or below the Check rows.
| Setup choice | Stored value |
|---|---|
| Completeness | COMPLETENESS |
| Consistency | CONSISTENCY |
| Timeliness | TIMELINESS |
| Eligibility | ELIGIBILITY |
| Readiness | READINESS |
| Risk | RISK |
| Compliance | COMPLIANCE |
| Relationship coverage | RELATIONSHIP_ |
Failure Severity (FailureSeverity__c )
Section titled “Failure Severity (FailureSeverity__c)”Optional restricted picklist. It applies only when the result is FAIL; it does not change PASS,
SKIPPED, UNABLE_TO_EVALUATE, or ERROR.
| Setup choice | Stored value | Card color |
|---|---|---|
| Critical | CRITICAL | Red |
| Warning | WARNING | Amber; default |
| Info | INFO | Blue |
Choose the business impact of failing the requirement. ERROR is not a severity choice because it
is a separate result that means Record Health Check encountered a technical problem.
Message When Failed (FailureMessage__c )
Section titled “Message When Failed (FailureMessage__c)”Optional Long Text Area(32,768), shown for FAIL. Explain what requirement was not met in language
the card user understands. Do not include SOQL, formulas, or exception details.
This field supports merge tokens. Press Enter for a new line on the card.
Choose the shortest useful example for the Check:
Found {!rhcResult.foundValue}; expected {!rhcResult.expectedValue}.
{!record.Name fallback="This Account"} has {!rhcResult.foundValue} open high-priority case{!rhcResult.foundValuePluralSuffix}.{!rhcResult.failedRecordCount} and {!rhcResult.totalRecordCount} are blank in this field. Put
row counts in Display: Found Text or Display: Expected Text instead.
Message When Unable To Evaluate (UnableToEvaluateMessage__c )
Section titled “Message When Unable To Evaluate (UnableToEvaluateMessage__c)”Optional Long Text Area(32,768). It replaces the standard message for UNABLE_TO_EVALUATE, which
is “This check could not be evaluated. Contact your administrator.” Explain that Salesforce could
not determine the result and what the user should do next. Do not show a query, formula, or
technical error on the card. Merge tokens and line breaks are supported.
Examples:
We could not confirm this requirement for {!record.Name fallback="this record"}.
Try again later. If the problem continues, give support run {!rhcRun.runId}, started at {!rhcRun.startedAt}.Some failures happen before Record Health Check can prepare the Check: invalid configuration, a field or relationship that does not exist, a formula dependency chain that is too deep, or a field the running user cannot read. Merge tokens cannot be filled in then, so a message that contains any token is replaced by the standard message. Write this message without tokens when it must appear in every case.
Avoid {!rhcResult.reasonCode} here. When Salesforce access blocks the Check while it runs, the
token inserts the specific code, FIELD_NOT_ACCESSIBLE or RECORD_NOT_ACCESSIBLE. Flow, Apex, and
the card’s result receive only the neutral CANNOT_EVALUATE for those failures, so that a user
cannot learn which record or field is hidden from them.
Fix Message (FixMessage__c )
Section titled “Fix Message (FixMessage__c)”Optional Long Text Area(32,768), shown in failed-Check details. Tell the user exactly what to review or change. Pair it with Action URL when Salesforce can take the user directly to the relevant record, related list, report, or instructions. Merge tokens are supported.
Examples:
Ask {!record.Owner.Name} to update the phone number for {!record.Name}; the current value is {!record.Phone fallback="not provided"}.
Review the open Opportunities and correct their Amount values, then rerun {!rhcSet.cardTitle}.Action Label (ActionLabel__c )
Section titled “Action Label (ActionLabel__c)”Optional Text(80) for the failure action link. Use a short verb phrase that describes where the link
goes, such as Edit Account, Review Contacts, or Open playbook. It supports merge tokens.
Action URL controls whether the link appears. When a URL is present and Action Label is blank, the card uses Fix this.
Examples:
Review {!record.Name}Review ContactsAction URL (ActionUrl__c )
Section titled “Action URL (ActionUrl__c)”Optional Long Text Area(32,768), displayed only for FAIL. Use a Salesforce path beginning with
/ or an https:// address. You can link to a record, edit page, related list, report,
Knowledge article, or external playbook.
Record, Check, Check Set, run, and query-row tokens are supported and URL-encoded automatically.
Result tokens (rhcResult.*) are not allowed in URLs. The card leaves out a completed URL that is
blank, longer than 2,000 characters, or not a same-org path or https:// address.
Examples:
/lightning/r/Account/{!record.Id}/view/lightning/r/Account/{!record.Id}/edit/lightning/r/Account/{!record.Id}/related/Contacts/view/lightning/o/Contact/new?defaultFieldValues=AccountId={!record.Id},LastName=New%20contact/lightning/o/Case/new?defaultFieldValues=AccountId={!record.Id},Subject=Review%20{!record.Name fallback="this account"},Origin=Web,Description=Check%20{!rhcCheck.developerName}%20in%20{!rhcSet.developerName}3. Check type and value display
Section titled “3. Check type and value display”Evaluation Type (EvaluationType__c )
Section titled “Evaluation Type (EvaluationType__c)”Required restricted picklist with no default. Choose one Evaluation Type, then complete only the fields that type uses.
| Setup choice | Stored value | Use it when |
|---|---|---|
| Verify with a formula | FORMULA | A true/false Salesforce formula can check fields on the current record. Configure Pass Condition. |
| Verify with a query | QUERY | One SOQL query can return the related records, count, total, or value to compare. |
| Compare two queries | COMPARE_ | The result from one SOQL query must be compared with another query result. |
| Verify with Apex | APEX | The requirement needs Apex logic that the other types cannot express. Configure Apex Class. |
Show Found and Expected (ComparisonDisplayMode__c )
Section titled “Show Found and Expected (ComparisonDisplayMode__c)”Optional restricted picklist, default Automatic (AUTOMATIC). It decides which comparison
values the Lightning card may show for this Check. Leaving it blank is the same as Automatic.
| Setup choice | Stored value | Card behavior |
|---|---|---|
| Automatic | AUTOMATIC | Both Found and Expected can appear. |
| Show found only | FOUND_ | Only the Found value can appear. |
| Show expected only | EXPECTED_ | Only the Expected value can appear. |
| Hide | HIDDEN | Neither value appears, inline or behind the caret. |
The comparison headings on the card are always Found and Expected, for every Evaluation Type; an Apex Check’s display labels cannot rename them.
This setting filters what is eligible to appear. It does not force a value to appear when the Check Set’s Found/Expected display placement would normally keep it hidden, and it applies to Formula, Query, Compare Two Queries, and Apex Checks alike.
When nothing remains visible, the card also removes the comparison divider, the caret, the expanded comparison region, and the Found/Expected phrases in the row’s accessible label. The failure message, Fix Message, action link, status, severity, title, description, and summary pills are unaffected.
Hide is not a security control. The evaluation result still carries both values, and they remain available to Apex, Flow, Platform Events, saved results, merge tokens, and authorized diagnostics. Use field-level security and sharing to protect data, never this setting.
If you choose Hide for a Check that has no failure message, Fix Message, or Action URL, validation reports a non-blocking warning: a failing Check would otherwise show the user a bare failure with no explanation. Evaluation still runs.
Display: Value Format (DisplayValueFormat__c )
Section titled “Display: Value Format (DisplayValueFormat__c)”Optional restricted picklist, default Automatic (AUTO). It changes only how Found and Expected
values appear; it never changes whether the Check passes.
| Setup choice | Stored value | Example use |
|---|---|---|
| Automatic | AUTO | Choose from the field definition and value type. |
| Number | NUMBER | Employee count |
| Currency | CURRENCY | Annual Revenue |
| Percent | PERCENT | A Salesforce Percent field |
| Ratio as percent | RATIO_ | Show 0. as 25% |
| Checkbox | BOOLEAN | True or false |
| Date | DATE | A date without time |
| Date/Time | DATETIME | A date and time |
| Text | TEXT | A name or description |
| Raw | RAW | An external ID without display formatting |
This is a different setting from Formula Result Type, which declares the return type of a Query Check’s comparison formulas. A Query Check can set Formula Result Type to Number for its Expected Value (Formula) and Display: Value Format to Currency at the same time.
Naming a format that cannot apply to a value is not an error. The value keeps its original spelling. Full contract: Reference: Display value format.
4. Check fields on this record (FORMULA)
Section titled “4. Check fields on this record (FORMULA)”Pass Condition (PassConditionFormula__c )
Section titled “Pass Condition (PassConditionFormula__c)”Long Text Area(32,768), required only for Verify with a formula. Enter a Salesforce formula that
returns true to pass or false to fail. Do not enter Apex or SOQL.
Examples:
| Formula | What passes |
|---|---|
TRUE | Every evaluated record |
NOT(ISBLANK(BillingCity)) | Billing City is populated |
OR(NOT(ISBLANK(Phone)), NOT(ISBLANK(Website))) | Phone or Website is populated |
AnnualRevenue >= 100000 | Annual Revenue is at least 100,000 |
ISPICKVAL(Type, "Customer - Direct") | Type is Customer - Direct |
NOT(ISBLANK(ParentId)) | A Parent Account is assigned |
Display: Found Formula (DisplayFoundFormula__c )
Section titled “Display: Found Formula (DisplayFoundFormula__c)”Optional Long Text Area(32,768) for Formula Checks. This formula supplies the Found value shown on the card; it does not affect pass or fail. Leave it blank when the card does not need a Found value.
Enter a formula evaluated on the current record. Fixed text uses double quotes, numbers are
unquoted, and Boolean values use TRUE or FALSE. Record Health Check detects each display
formula’s return type automatically; Formula Result Type does not control it.
Examples:
| Formula | Detected result type | Displayed value |
|---|---|---|
"Hello" | Text | Hello |
Name | Text | The current record’s Name |
Parent. | Text | The parent Account’s Name |
Name & " - " & TEXT(Rating) | Text | A combined value such as Acme - Hot |
IF(ISBLANK(Phone), "Missing", Phone) | Text | Missing or the current Phone |
BLANKVALUE(NumberOfEmployees, 0) | Number | Employee count, with blank shown as 0 |
AnnualRevenue | Number | Current Annual Revenue |
TODAY() | Date | The current date |
NOW() | Date/Time | The current date and time |
NOT(ISBLANK(Website)) | Checkbox | Yes when Website is populated |
Display: Expected Formula (DisplayExpectedFormula__c )
Section titled “Display: Expected Formula (DisplayExpectedFormula__c)”Optional Long Text Area(32,768) for Formula Checks. It supplies the Expected value shown on the
card and never changes pass or fail. When it is blank, the Expected value is the Pass Condition
formula itself, which only users with diagnostics access see; other users see no Expected value. A
{!rhcResult.expectedValue} token in a message still inserts that formula text for every user, so
set this field before you use that token on a Formula Check.
Examples:
| Formula | Detected result type | Displayed value |
|---|---|---|
"Complete" | Text | Complete |
BillingCountry | Text | The current Billing Country |
Parent. | Text | The parent Account’s Billing Country |
"City, State, and Country populated" | Text | A readable target statement |
10 | Number | 10 |
AnnualRevenue / 10 | Number | Ten percent of Annual Revenue |
DATE(YEAR(TODAY()), 12, 31) | Date | The final day of the current year |
NOW() + 7 | Date/Time | Seven days from the current time |
TRUE | Checkbox | Yes |
Formula Result Type (FormulaResultType__c )
Section titled “Formula Result Type (FormulaResultType__c)”Restricted picklist with an Automatic default. It declares the return type only when a Query Check calculates a comparison operand from Expected Value (Formula) or Value to find in the list (formula). An explicit type evaluates that operand once; Automatic can probe the supported types.
| Setup choice | Stored value | Choose it when the operand formula returns |
|---|---|---|
| Automatic | AUTO (default) | Any supported type. Record Health Check tries each type until one evaluates |
| Checkbox | BOOLEAN | true or false, such as IsActive |
| Number | NUMBER | A Number, Currency, or Percent value, such as AnnualRevenue * 0. |
| Date | DATE | A Date, such as CloseDate or TODAY() - 30 |
| Date/Time | DATETIME | A Date/Time, such as LastModifiedDate |
| Text | TEXT | Text, including a picklist converted with TEXT(), such as TEXT(Industry) |
It does not apply to Pass Condition or Applicability formulas, which must return Checkbox, or to Display: Found and Display: Expected formulas, which detect their own result type. For a Formula, Compare Two Queries, or Apex Check, leave the portable default Automatic. For a Query Check, leave Automatic unless an administrator has verified the exact result type of every configured comparison-operand formula that uses this shared setting.
5. Query sources (QUERY / COMPARE_TWO_QUERIES )
Section titled “5. Query sources (QUERY / COMPARE_TWO_QUERIES)”Source Query (SourceQuery__c )
Section titled “Source Query (SourceQuery__c)”Long Text Area(32,768). This is normally the first SOQL query for Verify with a query and
Compare two queries. Use COUNT() when the business question asks “how many?” and use record
merge tokens to filter for the current record.
Leave Source Query blank only for a one-query List contains any or List contains none Check. That pattern takes the value to search for from Value to find in the list (formula) and the list from Comparison Query.
Examples:
SELECT COUNT() FROM Contact WHERE AccountId = {!record.Id}SELECT SUM(Amount) totalAmount FROM Opportunity WHERE AccountId = {!record.Id} AND IsClosed = falseSource Query Field (SourceQueryField__c )
Section titled “Source Query Field (SourceQueryField__c)”Optional Text(255). Enter the field API name or aggregate alias whose value Record Health Check
must read from Source Query. For example, enter MailingCity for SELECT MailingCity ..., or
totalAmount for the aliased SUM(Amount) query below.
Leave this field blank only when Source Query uses bare COUNT(). Give SUM(), MIN(), MAX(),
AVG(), COUNT(field), and COUNT_DISTINCT(field) an alias and enter that alias here.
Example: use totalAmount for the aliased aggregate below. Leave this field blank for bare COUNT().
SELECT SUM(Amount) totalAmount FROM Opportunity WHERE AccountId = {!record.Id}Comparison Query (ComparisonQuery__c )
Section titled “Comparison Query (ComparisonQuery__c)”Long Text Area(32,768). This is the second SOQL query when:
- Evaluation Type is Compare two queries;
- Expected Value Comes From is Comparison query; or
- a one-query Check uses List contains any or List contains none.
Use Comparison Query Field to identify the selected field or aggregate alias to read.
Examples:
SELECT COUNT() FROM Opportunity WHERE AccountId = {!record.Id} AND IsClosed = falseSELECT AnnualRevenue FROM Account WHERE Id = {!record.ParentId fallback="001000000000000AAA"}SELECT EndDate FROM Contract WHERE AccountId = {!record.Id} AND Status = 'Activated' ORDER BY EndDate LIMIT 1SELECT MailingState FROM Contact WHERE AccountId = {!record.Id} AND MailingState != nullComparison Query Field (ComparisonQueryField__c )
Section titled “Comparison Query Field (ComparisonQueryField__c)”Optional Text(255). It follows the same rule as Source Query Field: enter the selected field API
name or aggregate alias, and leave it blank only for bare COUNT().
Example: use comparisonTotal for the aliased aggregate below.
SELECT SUM(Amount) comparisonTotal FROM Opportunity WHERE AccountId = {!record.Id} AND IsClosed = falseValue to find in the list (formula) (FindInListFormula__c )
Section titled “Value to find in the list (formula) (FindInListFormula__c)”Long Text Area(32,768), required only for a Verify with a query Check using List contains any or List contains none. Enter a Salesforce formula that returns the one value to search for. The Comparison Query returns the list.
For example, enter BillingCity to look for the Account’s Billing City, or "Chicago" to look for
fixed text. Also set How To Read Query Results to Compare as lists. Leave this field blank for
all other operators.
6. Query comparison
Section titled “6. Query comparison”Comparison Operator (ComparisonOperator__c )
Section titled “Comparison Operator (ComparisonOperator__c)”Required restricted picklist with no default for Query and Compare two queries Checks.
| Setup choice | Stored value | Used with | Passes when | Card reads Expected as |
|---|---|---|---|---|
| Equal to | EQUALS | One value or aggregate | Found equals Expected. Text ignores letter case | to equal 5 |
| Not equal to | NOT_ | One value or aggregate | Found does not equal Expected. Text ignores letter case | to not equal 5 |
| Greater than | GREATER_ | One value or aggregate | Found is greater than Expected | more than 5 |
| At least | GREATER_ | One value or aggregate | Found is greater than or equal to Expected | at least 5 |
| Less than | LESS_ | One value or aggregate | Found is less than Expected | less than 5 |
| At most | LESS_ | One value or aggregate | Found is less than or equal to Expected | at most 5 |
| Contains text | CONTAINS | Text value | Found text contains Expected text. Letter case must match | to contain Inc |
| Does not contain text | DOES_ | Text value | Found text does not contain Expected text. Letter case must match | to not contain Inc |
| Is empty | IS_ | No Expected value needed | Found is empty or only spaces | to be blank |
| Is not empty | IS_ | No Expected value needed | Found has a value | to not be blank |
| List contains any | LIST_ | One-query list search | The value from Value to find in the list (formula) appears in the Comparison Query’s list | to be one of [. |
| List contains none | LIST_ | One-query list search | That value does not appear in the Comparison Query’s list | to be none of [. |
| Lists overlap | LISTS_ | Compare two query result lists | At least one value is in both lists | to overlap with [. |
| Lists contain all | LISTS_ | Compare two query result lists | The Comparison Query’s list contains every value in the Source Query’s list; it may contain more | to contain all of [. |
| Lists match exactly | LISTS_ | Compare two query result lists | Both lists contain the same values the same number of times, in any order | to exactly match [. |
The greater-than and less-than operators compare numbers and dates by value. Applied to text, they
return UNABLE_TO_EVALUATE with INCOMPATIBLE_COMPARISON_TYPES, as do Contains text and Does
not contain text when either side is not text. List operators ignore letter case. For every
operator except Is empty and Is not empty, If Field Value Is Empty decides what happens
when Found or Expected is empty.
Every list operator requires How To Read Query Results = Compare as lists.
Expected Value Comes From (ExpectedValueSource__c )
Section titled “Expected Value Comes From (ExpectedValueSource__c)”Use this restricted picklist for a Verify with a query Check when its operator needs an Expected value. There is no default.
| Setup choice | Stored value | Complete this field |
|---|---|---|
| Fixed value | FIXED_ | Expected Value (Fixed) |
| Record formula | RECORD_ | Expected Value (Formula) |
| Comparison query | COMPARISON_ | Comparison Query and, when needed, Comparison Query Field |
Leave it blank for Is empty, Is not empty, List contains any, List contains none, and Compare two queries.
Expected Value (Fixed) (ExpectedFixedValue__c )
Section titled “Expected Value (Fixed) (ExpectedFixedValue__c)”Text(255), required when Expected Value Comes From is Fixed value. Enter a plain value with no
formula syntax or quotation marks: Approved, 5, or 2025-01-31.
Expected Currency ISO Code (ExpectedCurrencyIsoCode__c )
Section titled “Expected Currency ISO Code (ExpectedCurrencyIsoCode__c)”Optional Text(3), except that it is required in a multi-currency org when a Query Check compares a
Currency field with a fixed value; without it, the Check returns UNABLE_TO_EVALUATE with
FIXED_CURRENCY_BASIS_MISSING. Enter the fixed value’s ISO unit, such as USD or EUR. This
declaration lets Record Health Check refuse a cross-unit comparison; it never converts a value.
Leave it blank in single-currency orgs, for non-Currency fields, and for expected values that do not
come from Fixed value.
Expected Value (Formula) (ExpectedRecordFormula__c )
Section titled “Expected Value (Formula) (ExpectedRecordFormula__c)”Long Text Area(32,768), required when Expected Value Comes From is Record formula. Enter a Salesforce formula evaluated on the current record. It can return fixed text, a field, relationship field, or calculated value. Do not enter Apex or SOQL.
Examples:
| Formula | Formula Result Type | Value used for comparison |
|---|---|---|
"Approved" | Text | The literal text Approved |
BillingCity | Text | The current record’s Billing City |
Parent. | Text | The parent Account’s Billing City |
5 | Number | The number 5 |
BLANKVALUE(Parent. | Number | The parent Account’s Annual Revenue, with blank shown as 0 |
DATE(YEAR(TODAY()), 12, 31) | Date | The final day of the current year |
NOW() + 7 | Date/Time | Seven days from the current time |
TRUE | Checkbox | true |
7. Advanced query behavior
Section titled “7. Advanced query behavior”How To Read Query Results (QueryResultHandling__c )
Section titled “How To Read Query Results (QueryResultHandling__c)”Restricted picklist for Query and Compare two queries Checks. The default is One row or aggregate.
| Setup choice | Stored value | Meaning |
|---|---|---|
| One row or aggregate | ONE_ | Read one row, COUNT(), SUM(), or another aggregate. This is the default. |
| Any record passes | ANY_ | The Check passes when at least one returned record matches. |
| Every record passes | ALL_ | The Check passes only when every returned record matches. |
| Compare as lists | COMPARE_ | Treat query results as lists. Required for every list operator. |
If Query Finds No Records (NoRowsResult__c )
Section titled “If Query Finds No Records (NoRowsResult__c)”Required with Any record passes, Every record passes, and Compare as lists. There is no default because no records can have different business meanings.
| Setup choice | Stored value | Use it when no records means… |
|---|---|---|
| Pass | PASS | The requirement is satisfied. For example, no open high-priority Cases is healthy. |
| Fail | FAIL | A required related record is missing. |
| Skip | SKIP | The Check does not apply. |
| Unable to evaluate | UNABLE_ | The available data cannot answer the question. |
If Field Value Is Empty (EmptyValueHandling__c )
Section titled “If Field Value Is Empty (EmptyValueHandling__c)”Optional restricted picklist for non-aggregate Query and Compare two queries Checks.
| Setup choice | Stored value | Behavior |
|---|---|---|
| Ignore the record | SKIP_ | Leave that returned record out of the comparison. |
| Treat as blank | AS_ | Compare the value as blank text. |
| Treat as not matching | AS_ | The empty value does not match. This is the default. |
Formula Checks, Apex Checks, and aggregate queries ignore this field.
Max Query Rows (1-2000) (MaxQueryRows__c )
Section titled “Max Query Rows (1-2000) (MaxQueryRows__c)”Optional Number(4,0) from 1 through 2000; default 200. It limits rows returned by this Check’s
Query or Compare two queries SOQL.
When one record’s query returns more rows, the Check returns UNABLE_TO_EVALUATE with
ROW_LIMIT_EXCEEDED rather than deciding from part of the data. When Flow, Apex, or a background job
checks several records at once, one query serves all of them, so the limit applies to the rows for
all those records together; exceeding it returns SCOPE_ROW_CAP_EXCEEDED. See
Row limits apply to the combined query.
Keep it as low as the business question allows because each row uses Salesforce query rows, memory, and processing time in the current transaction. Narrow the SOQL before increasing this number. If more than 200 rows are genuinely required, test the real Check and realistic records in a sandbox.
8. Advanced display text
Section titled “8. Advanced display text”Display: Found Text (DisplayFoundText__c )
Section titled “Display: Found Text (DisplayFoundText__c)”Optional Text(255) that replaces the Found line for Formula, Query, and Compare two queries Checks. It changes only the displayed text, not the result. For an Every record passes query, it replaces the generated “N of M records did not pass” summary.
Merge tokens are supported, including {!rhcResult.foundValue} for the original value. On an
Every record passes Query Check, {!rhcResult.failedRecordCount} and
{!rhcResult.totalRecordCount} insert the failing and reviewed row counts; on other Checks they are
blank. Apex Checks return their own Found value, so this field is ignored for Apex and validation
reports APEX_DISPLAY_TEXT_IGNORED.
Examples:
{!rhcResult.failedRecordCount} of {!rhcResult.totalRecordCount} contacts for {!record.Name} are missing email.Display: Expected Text (DisplayExpectedText__c )
Section titled “Display: Expected Text (DisplayExpectedText__c)”Optional Text(255) that replaces the Expected line for Formula, Query, and Compare two queries Checks. It changes only the displayed text. On a Formula Check, it replaces the generated Passes when text.
Merge tokens are supported, including {!rhcResult.expectedValue} for the original value. Apex
Checks return their own Expected value, so this field is ignored for Apex and validation reports
APEX_DISPLAY_TEXT_IGNORED.
Examples (choose one that fits the Check):
Expected {!rhcResult.expectedValue} for every contact related to {!record.Name}.
All {!rhcResult.totalRecordCount} contacts should have an email address.9. When this check applies
Section titled “9. When this check applies”Applies To (ApplicabilityMode__c )
Section titled “Applies To (ApplicabilityMode__c)”Optional restricted picklist. It decides whether the Check applies before Record Health Check runs
its pass/fail logic. When the condition is not met, the result is SKIPPED, not FAIL.
| Setup choice | Stored value | Configure next |
|---|---|---|
| All records | ALL_ | Nothing; this is the default. |
| When a formula is true | WHEN_ | Applies When (Formula) |
| When a count query matches | WHEN_ | Applies When (Count Query), Count Must Be, and Count Value |
Message When Not Applicable (ApplicabilityNotMetMessage__c )
Section titled “Message When Not Applicable (ApplicabilityNotMetMessage__c)”Optional Long Text Area(32,768). Explain why a conditional Check was skipped. It supports
merge tokens except rhcQuery, because the Check’s queries never run
when it is skipped. A picklist token such as {!record.Type} inserts the stored value; add
format="AUTO" to show the picklist label.
Examples:
{!record.Name} is a {!record.Type} account; this requirement applies only to channel partners.
This Check applies only to channel-partner Accounts.Applies When (Formula) (ApplicabilityFormula__c )
Section titled “Applies When (Formula) (ApplicabilityFormula__c)”Long Text Area(32,768), required when Applies To is When a formula is true. Enter a
Salesforce formula evaluated on the current record. true runs the Check; false produces
SKIPPED with Reason Code NOT_APPLICABLE_BY_FORMULA. A formula that cannot return true or
false, for example because it reads a field the user cannot access, produces UNABLE_TO_EVALUATE
instead. Example: ISPICKVAL(Type, "Customer - Direct").
Applies When (Count Query) (ApplicabilityCountQuery__c )
Section titled “Applies When (Count Query) (ApplicabilityCountQuery__c)”Long Text Area(32,768), required when Applies To is When a count query matches. Enter a
COUNT() SOQL query. Record Health Check compares the returned count with Count Must Be and
Count Value. A matching count runs the Check; a nonmatching count produces SKIPPED with Reason
Code NOT_APPLICABLE_BY_COUNT. The query follows the same rules as Source Query, including at most
one unquoted {!record.…} token; see Bulk query grammar.
This query decides only whether the Check applies. It does not decide pass or fail.
Examples:
SELECT COUNT() FROM Opportunity WHERE AccountId = {!record.Id} AND IsClosed = falseCount Must Be (ApplicabilityCountOperator__c )
Section titled “Count Must Be (ApplicabilityCountOperator__c)”Required restricted picklist when Applies To is When a count query matches.
| Setup choice | Stored value |
|---|---|
| Equal to | EQUALS |
| Not equal to | NOT_ |
| Greater than | GREATER_ |
| At least | GREATER_ |
| Less than | LESS_ |
| At most | LESS_ |
Count Value (ApplicabilityCountThreshold__c )
Section titled “Count Value (ApplicabilityCountThreshold__c)”Number(4,0), required when Applies To is When a count query matches. This is the number used
with Count Must Be. For example, Greater than and 0 runs the Check only when the query finds at
least one record.
Prerequisite Check (PrerequisiteCheck__c )
Section titled “Prerequisite Check (PrerequisiteCheck__c)”Optional Text(255). Enter the Record Health Check Name (Developer Name) shown in Setup, not the
Check Title, of another active Check in the same Check Set. That Check must return PASS before this
Check can run. It may have an earlier or later Evaluation Order; Record Health Check runs it first.
During a complete Check Set run, any prerequisite result other than PASS makes this Check
SKIPPED. When the named prerequisite is missing, inactive, or misspelled, this Check is also
SKIPPED, with Reason Code DEPENDENCY_NOT_IN_RUN. Run
configuration validation to find the error.
A single-Check request evaluates only the selected Check. The Flow action Run Record Health
Check, the Agentforce action Run Record Health Check for Agentforce, and Apex
rhc.RecordHealthCheckRequest.forCheck(...) therefore do not load or enforce this dependency. The
record-page card and every Check Set request enforce it. Example: Account_Phone_Is_Present.
10. Custom Apex (APEX)
Section titled “10. Custom Apex (APEX)”Apex Class (ApexClass__c )
Section titled “Apex Class (ApexClass__c)”Text(255), required for Verify with Apex. Enter the API name of a global Apex class that
implements rhc.RecordHealthCheckPlugin. Enter the name without a namespace: Record Health Check
looks for the class in the package first and then in your org, so do not give your own class the
name of a packaged class. For a class in another namespace, enter namespace.ClassName.
For example, AccountHasRecentActivityCheck is included with the installed Record Health Check
package. A class created by your development team might be named MyAccountApprovalCheck. See the
Apex Check examples for the complete class contract and tests.
Apex Parameters (JSON) (ApexParametersJson__c )
Section titled “Apex Parameters (JSON) (ApexParametersJson__c)”Optional Long Text Area(32,768) for Apex Checks. Enter valid JSON required by the class, such as
{"daysBack": 90} for AccountHasRecentActivityCheck. Leave it blank when the class has no
parameters.
The values belong only to this Check. Invalid JSON produces UNABLE_TO_EVALUATE with reason code
INVALID_APEX_PARAMETERS. When the class declares its parameters, the same result follows from an
unknown key, a value of the wrong type, a value outside the declared range, or a missing required
value, and an omitted key takes the declared default. See
Declare and validate parameters.
Lifecycle events
Section titled “Lifecycle events”Publish User Result Event (PublishUserResultEvent__c )
Section titled “Publish User Result Event (PublishUserResultEvent__c)”Checkbox, cleared by default. Select this field only when a Platform Event-triggered Flow, Apex trigger, or integration must receive this individual Check result after a person clicks Run or Rerun on the Lightning card. An automatic page-load check does not publish it.
This checkbox does not control Flow, Apex, Batch, Queueable, or Scheduled Apex runs, which choose
NONE, ACTIONABLE, or ALL when they start. For example, ALL publishes every result even when
this checkbox is cleared. Agentforce actions and the REST endpoint never publish.
Leave it cleared when nothing receives the event. Select it only for the individual Checks the receiving automation uses; publishing one event per Check can create considerably more Platform Events than publishing one Check Set summary. See Decide when to use Platform Events.