Skip to content

Check fields

Reference30 min read

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 valueName
Custom Metadata Type labelRecord Health Check
Custom Metadata Type API nameRecord_Health_Check__mdt

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.

StageDecisionStart with
1. Place the CheckWhich Check Set owns it, when does it run, and is it active?Check Set, Evaluation Order, and Active
2. Decide whether it appliesDoes 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 evaluatesCan Salesforce formula or SOQL express the check, or is Apex required?Evaluation Type
4. Define the decisionWhat value is found, what is expected, and how are they compared?The Evaluation Type table below
5. Explain the resultWhat should someone understand and do after a failure or an unable result?Check Title, Message When Failed, and Fix Message
6. Add a next actionWould a safe same-org destination help resolve the result?Action Label and Action URL
7. Publish when neededDoes another process need the finalized Check outcome?Publish User Result Event
What the Check must verifyEvaluation TypeStart with
Fields on the current Salesforce recordVerify with a formula (FORMULA)Pass Condition
Records or an aggregate returned by one SOQL queryVerify with a query (QUERY)Source Query and Comparison Operator
One SOQL result against another SOQL resultCompare two queries (COMPARE_TWO_QUERIES)Source Query and Comparison Query
Logic implemented in a package or org Apex classVerify 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.

Setup labelAPI nameGroup
Record Health Check NameDeveloperNameIdentity and execution
LabelMasterLabelIdentity and execution
Check SetRecord_Health_Check_Set__cIdentity and execution
Evaluation OrderEvaluationOrder__cIdentity and presentation
ActiveIsActive__cIdentity and execution
Check TitleCheckTitle__cWhat users see
Check DescriptionCheckDescription__cWhat users see
CategoryCategory__cWhat users see
Failure SeverityFailureSeverity__cWhat users see
Message When FailedFailureMessage__cWhat users see
Message When Unable To EvaluateUnableToEvaluateMessage__cWhat users see
Fix MessageFixMessage__cWhat users see
Action LabelActionLabel__cWhat users see
Action URLActionUrl__cWhat users see
Evaluation TypeEvaluationType__cCheck type and value display
Display: Value FormatDisplayValueFormat__cCheck type and value display
Show Found and ExpectedComparisonDisplayMode__cCheck type and value display
Pass ConditionPassConditionFormula__cCheck fields on this record (FORMULA)
Display: Found FormulaDisplayFoundFormula__cOptional result display
Display: Expected FormulaDisplayExpectedFormula__cOptional result display
Formula Result TypeFormulaResultType__cQuery comparison formulas
Source QuerySourceQuery__cQuery sources (QUERY / COMPARE_TWO_QUERIES)
Source Query FieldSourceQueryField__cQuery sources (QUERY / COMPARE_TWO_QUERIES)
Comparison QueryComparisonQuery__cQuery sources (QUERY / COMPARE_TWO_QUERIES)
Comparison Query FieldComparisonQueryField__cQuery sources (QUERY / COMPARE_TWO_QUERIES)
Value to find in the list (formula)FindInListFormula__cQuery sources (QUERY / COMPARE_TWO_QUERIES)
Comparison OperatorComparisonOperator__cQuery comparison
Expected Value Comes FromExpectedValueSource__cQuery comparison
Expected Value (Fixed)ExpectedFixedValue__cQuery comparison
Expected Currency ISO CodeExpectedCurrencyIsoCode__cQuery comparison
Expected Value (Formula)ExpectedRecordFormula__cQuery comparison
How To Read Query ResultsQueryResultHandling__cAdvanced query behavior
If Query Finds No RecordsNoRowsResult__cAdvanced query behavior
If Field Value Is EmptyEmptyValueHandling__cAdvanced query behavior
Max Query Rows (1-2000)MaxQueryRows__cAdvanced query behavior
Display: Found TextDisplayFoundText__cAdvanced display text
Display: Expected TextDisplayExpectedText__cAdvanced display text
Applies ToApplicabilityMode__cWhen this check applies
Applies When (Formula)ApplicabilityFormula__cWhen this check applies
Applies When (Count Query)ApplicabilityCountQuery__cWhen this check applies
Message When Not ApplicableApplicabilityNotMetMessage__cFriendly explanation for a skipped check
Count Must BeApplicabilityCountOperator__cWhen this check applies
Count ValueApplicabilityCountThreshold__cWhen this check applies
Prerequisite CheckPrerequisiteCheck__cWhen this check applies
Apex ClassApexClass__cCustom Apex (APEX)
Apex Parameters (JSON)ApexParametersJson__cCustom Apex (APEX)
Publish User Result EventPublishUserResultEvent__cLifecycle events

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.

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.

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.

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.

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.

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.

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.

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 choiceStored value
CompletenessCOMPLETENESS
ConsistencyCONSISTENCY
TimelinessTIMELINESS
EligibilityELIGIBILITY
ReadinessREADINESS
RiskRISK
ComplianceCOMPLIANCE
Relationship coverageRELATIONSHIP_COVERAGE

Optional restricted picklist. It applies only when the result is FAIL; it does not change PASS, SKIPPED, UNABLE_TO_EVALUATE, or ERROR.

Setup choiceStored valueCard color
CriticalCRITICALRed
WarningWARNINGAmber; default
InfoINFOBlue

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.

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.

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}.

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 Contacts

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}

Required restricted picklist with no default. Choose one Evaluation Type, then complete only the fields that type uses.

Setup choiceStored valueUse it when
Verify with a formulaFORMULAA true/false Salesforce formula can check fields on the current record. Configure Pass Condition.
Verify with a queryQUERYOne SOQL query can return the related records, count, total, or value to compare.
Compare two queriesCOMPARE_TWO_QUERIESThe result from one SOQL query must be compared with another query result.
Verify with ApexAPEXThe 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 choiceStored valueCard behavior
AutomaticAUTOMATICBoth Found and Expected can appear.
Show found onlyFOUND_ONLYOnly the Found value can appear.
Show expected onlyEXPECTED_ONLYOnly the Expected value can appear.
HideHIDDENNeither 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 choiceStored valueExample use
AutomaticAUTOChoose from the field definition and value type.
NumberNUMBEREmployee count
CurrencyCURRENCYAnnual Revenue
PercentPERCENTA Salesforce Percent field
Ratio as percentRATIO_PERCENTShow 0.25 as 25%
CheckboxBOOLEANTrue or false
DateDATEA date without time
Date/TimeDATETIMEA date and time
TextTEXTA name or description
RawRAWAn 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.

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:

FormulaWhat passes
TRUEEvery evaluated record
NOT(ISBLANK(BillingCity))Billing City is populated
OR(NOT(ISBLANK(Phone)), NOT(ISBLANK(Website)))Phone or Website is populated
AnnualRevenue >= 100000Annual 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:

FormulaDetected result typeDisplayed value
"Hello"TextHello
NameTextThe current record’s Name
Parent.NameTextThe parent Account’s Name
Name & " - " & TEXT(Rating)TextA combined value such as Acme - Hot
IF(ISBLANK(Phone), "Missing", Phone)TextMissing or the current Phone
BLANKVALUE(NumberOfEmployees, 0)NumberEmployee count, with blank shown as 0
AnnualRevenueNumberCurrent Annual Revenue
TODAY()DateThe current date
NOW()Date/TimeThe current date and time
NOT(ISBLANK(Website))CheckboxYes 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:

FormulaDetected result typeDisplayed value
"Complete"TextComplete
BillingCountryTextThe current Billing Country
Parent.BillingCountryTextThe parent Account’s Billing Country
"City, State, and Country populated"TextA readable target statement
10Number10
AnnualRevenue / 10NumberTen percent of Annual Revenue
DATE(YEAR(TODAY()), 12, 31)DateThe final day of the current year
NOW() + 7Date/TimeSeven days from the current time
TRUECheckboxYes

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 choiceStored valueChoose it when the operand formula returns
AutomaticAUTO (default)Any supported type. Record Health Check tries each type until one evaluates
CheckboxBOOLEANtrue or false, such as IsActive
NumberNUMBERA Number, Currency, or Percent value, such as AnnualRevenue * 0.1
DateDATEA Date, such as CloseDate or TODAY() - 30
Date/TimeDATETIMEA Date/Time, such as LastModifiedDate
TextTEXTText, 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)”

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 = false

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}

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 = false
SELECT AnnualRevenue FROM Account WHERE Id = {!record.ParentId fallback="001000000000000AAA"}
SELECT EndDate FROM Contract WHERE AccountId = {!record.Id} AND Status = 'Activated' ORDER BY EndDate LIMIT 1
SELECT MailingState FROM Contact WHERE AccountId = {!record.Id} AND MailingState != null

Comparison 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 = false

Value 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.

Comparison Operator (ComparisonOperator__c)

Section titled “Comparison Operator (ComparisonOperator__c)”

Required restricted picklist with no default for Query and Compare two queries Checks.

Setup choiceStored valueUsed withPasses whenCard reads Expected as
Equal toEQUALSOne value or aggregateFound equals Expected. Text ignores letter caseto equal 5
Not equal toNOT_EQUALSOne value or aggregateFound does not equal Expected. Text ignores letter caseto not equal 5
Greater thanGREATER_THANOne value or aggregateFound is greater than Expectedmore than 5
At leastGREATER_THAN_OR_EQUALOne value or aggregateFound is greater than or equal to Expectedat least 5
Less thanLESS_THANOne value or aggregateFound is less than Expectedless than 5
At mostLESS_THAN_OR_EQUALOne value or aggregateFound is less than or equal to Expectedat most 5
Contains textCONTAINSText valueFound text contains Expected text. Letter case must matchto contain Inc
Does not contain textDOES_NOT_CONTAINText valueFound text does not contain Expected text. Letter case must matchto not contain Inc
Is emptyIS_BLANKNo Expected value neededFound is empty or only spacesto be blank
Is not emptyIS_NOT_BLANKNo Expected value neededFound has a valueto not be blank
List contains anyLIST_CONTAINS_ANYOne-query list searchThe value from Value to find in the list (formula) appears in the Comparison Query’s listto be one of [...]
List contains noneLIST_CONTAINS_NONEOne-query list searchThat value does not appear in the Comparison Query’s listto be none of [...]
Lists overlapLISTS_OVERLAPCompare two query result listsAt least one value is in both liststo overlap with [...]
Lists contain allLISTS_CONTAIN_ALLCompare two query result listsThe Comparison Query’s list contains every value in the Source Query’s list; it may contain moreto contain all of [...]
Lists match exactlyLISTS_MATCH_EXACTLYCompare two query result listsBoth lists contain the same values the same number of times, in any orderto 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 choiceStored valueComplete this field
Fixed valueFIXED_VALUEExpected Value (Fixed)
Record formulaRECORD_FORMULAExpected Value (Formula)
Comparison queryCOMPARISON_QUERYComparison 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:

FormulaFormula Result TypeValue used for comparison
"Approved"TextThe literal text Approved
BillingCityTextThe current record’s Billing City
Parent.BillingCityTextThe parent Account’s Billing City
5NumberThe number 5
BLANKVALUE(Parent.AnnualRevenue, 0)NumberThe parent Account’s Annual Revenue, with blank shown as 0
DATE(YEAR(TODAY()), 12, 31)DateThe final day of the current year
NOW() + 7Date/TimeSeven days from the current time
TRUECheckboxtrue

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 choiceStored valueMeaning
One row or aggregateONE_RESULTRead one row, COUNT(), SUM(), or another aggregate. This is the default.
Any record passesANY_ROW_PASSESThe Check passes when at least one returned record matches.
Every record passesALL_ROWS_PASSThe Check passes only when every returned record matches.
Compare as listsCOMPARE_AS_LISTSTreat 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 choiceStored valueUse it when no records means…
PassPASSThe requirement is satisfied. For example, no open high-priority Cases is healthy.
FailFAILA required related record is missing.
SkipSKIPThe Check does not apply.
Unable to evaluateUNABLE_TO_EVALUATEThe 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 choiceStored valueBehavior
Ignore the recordSKIP_RECORDLeave that returned record out of the comparison.
Treat as blankAS_BLANKCompare the value as blank text.
Treat as not matchingAS_NO_MATCHThe empty value does not match. This is the default.

Formula Checks, Apex Checks, and aggregate queries ignore this field.

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.

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.

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 choiceStored valueConfigure next
All recordsALL_RECORDSNothing; this is the default.
When a formula is trueWHEN_FORMULA_TRUEApplies When (Formula)
When a count query matchesWHEN_COUNT_QUERY_MATCHESApplies 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 = false

Count Must Be (ApplicabilityCountOperator__c)

Section titled “Count Must Be (ApplicabilityCountOperator__c)”

Required restricted picklist when Applies To is When a count query matches.

Setup choiceStored value
Equal toEQUALS
Not equal toNOT_EQUALS
Greater thanGREATER_THAN
At leastGREATER_THAN_OR_EQUAL
Less thanLESS_THAN
At mostLESS_THAN_OR_EQUAL

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.

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.

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.

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.