Reference
Check fields
Detailed page. Use “On this page” to jump directly to the section you need.
Find every Record Health Check metadata field by its Salesforce label or API name.
Look up every Check field by its Setup label or API name. Each field explains 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_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.
For a Formula-only Check, use the identity and message fields plus Pass Condition and ignore the SOQL, Compare Two Queries, and Apex sections. Query configuration requires someone who can review SOQL safely. Verify with Apex, Apex Class, and Apex Parameters (JSON) require a developer to own the class, tests, and deployment.
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_TWO_QUERIES) | 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 Syntax:
record.*, rhcResult.*, rhcRun.*, rhcCheck.*, and rhcSet.*.
Prerequisite Check stores the prerequisite’s Developer Name within the same Check Set, not its
card title. Card Publish User Result Event controls explicit Run/Rerun only; Flow and Apex
publication values control programmatic runs. Action links render only for FAIL, not System Error
or Unable to Check rows.
Field index
Section titled “Field index”| Setup label | API name | Group |
|---|---|---|
| Developer Name | DeveloperName | Identity and execution |
| Label | MasterLabel | Identity and execution |
| Check Set | Record_Health_Check_Set__c | Identity and execution |
| Evaluation Order | EvaluationOrder__c | Identity and presentation |
| Active | IsActive__c | Identity and execution |
| Check Title | CheckTitle__c | What users see |
| Check Description | CheckDescription__c | What users see |
| Category | Category__c | What users see |
| Failure Severity | FailureSeverity__c | What users see |
| Message When Failed | FailureMessage__c | What users see |
| Message When Unable To Evaluate | UnableToEvaluateMessage__c | What users see |
| Fix Message | FixMessage__c | What users see |
| Action Label | ActionLabel__c | What users see |
| Action URL | ActionUrl__c | What users see |
| Evaluation Type | EvaluationType__c | Check type and value display |
| Display: Value Format | DisplayValueFormat__c | Check type and value display |
| Show Found and Expected | ComparisonDisplayMode__c | Check type and value display |
| Pass Condition | PassConditionFormula__c | Check fields on this record (FORMULA) |
| Display: Found Formula | DisplayFoundFormula__c | Optional result display |
| Display: Expected Formula | DisplayExpectedFormula__c | Optional result display |
| Formula Result Type | FormulaResultType__c | Query comparison formulas |
| Source Query | SourceQuery__c | Query sources (QUERY / COMPARE_TWO_QUERIES) |
| Source Query Field | SourceQueryField__c | Query sources (QUERY / COMPARE_TWO_QUERIES) |
| Comparison Query | ComparisonQuery__c | Query sources (QUERY / COMPARE_TWO_QUERIES) |
| Comparison Query Field | ComparisonQueryField__c | Query sources (QUERY / COMPARE_TWO_QUERIES) |
| Value to find in the list (formula) | FindInListFormula__c | Query sources (QUERY / COMPARE_TWO_QUERIES) |
| Comparison Operator | ComparisonOperator__c | Query comparison |
| Expected Value Comes From | ExpectedValueSource__c | Query comparison |
| Expected Value (Fixed) | ExpectedFixedValue__c | Query comparison |
| Expected Currency ISO Code | ExpectedCurrencyIsoCode__c | Query comparison |
| Expected Value (Formula) | ExpectedRecordFormula__c | Query comparison |
| How To Read Query Results | QueryResultHandling__c | Advanced query behavior |
| If Query Finds No Records | NoRowsResult__c | Advanced query behavior |
| If Field Value Is Empty | EmptyValueHandling__c | Advanced query behavior |
| Max Query Rows (1-2000) | MaxQueryRows__c | Advanced query behavior |
| Display: Found Text | DisplayFoundText__c | Advanced display text |
| Display: Expected Text | DisplayExpectedText__c | Advanced display text |
| Applies To | ApplicabilityMode__c | When this check applies |
| Applies When (Formula) | ApplicabilityFormula__c | When this check applies |
| Applies When (Count Query) | ApplicabilityCountQuery__c | When this check applies |
| Message When Not Applicable | ApplicabilityNotMetMessage__c | Friendly explanation for a skipped check |
| Count Must Be | ApplicabilityCountOperator__c | When this check applies |
| Count Value | ApplicabilityCountThreshold__c | When this check applies |
| Prerequisite Check | PrerequisiteCheck__c | When this check applies |
| Apex Class | ApexClass__c | Custom Apex (APEX) |
| Apex Parameters (JSON) | ApexParametersJson__c | Custom Apex (APEX) |
| Publish User Result Event | PublishUserResultEvent__c | Lifecycle events |
1. Identity and execution
Section titled “1. Identity and execution”Developer Name (DeveloperName)
Section titled “Developer Name (DeveloperName)”Required Text(40). This is 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.
After saving, Setup shows the complete Qualified API Name. A Check created by an administrator
in your org normally has a name such as Account_Pipeline_Readiness. A Check included with the
installed package can have a name such as rhc__Account_Has_Recent_Activity. Copy the exact value
from Setup; do not add or remove rhc__.
Label (MasterLabel)
Section titled “Label (MasterLabel)”Required Text(80). 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 appear first. When two Checks
have the same number, Salesforce 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. After a run, categorized Checks produce grouped category summaries that replace the single overall totals bar. The Check Set’s Summary Display setting places those groups 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_COVERAGE |
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}.
{!rhcResult.failedRecordCount} of {!rhcResult.totalRecordCount} contacts for {!record.Name} are missing email.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.
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 the requirement for {!record.Name} ({!rhcResult.reasonCode}).
Try again later. If the problem continues, give support run {!rhcRun.runId}, started at {!rhcRun.startedAt}.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 approved https:// address. You can link to a record, edit page, related list, report,
Knowledge article, or external playbook.
Record, Check, Check Set, and run tokens are supported and URL-encoded automatically. Result tokens are not allowed in URLs. The card hides blank, unsafe, or overlong resolved URLs.
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_TWO_QUERIES | 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
evidence the Lightning card may show for this Check. Leaving it blank is the same as Automatic,
so Checks created before this field existed keep their current behavior.
| Setup choice | Stored value | Card behavior |
|---|---|---|
| Automatic | AUTOMATIC | Found and Expected appear exactly as they do today. |
| Show found only | FOUND_ONLY | Only the Found value can appear. |
| Show expected only | EXPECTED_ONLY | Only the Expected value can appear. |
| Hide | HIDDEN | Neither value appears, inline or behind the caret. |
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 | Let Record Health Check choose from the value type. |
| Number | NUMBER | Employee count |
| Currency | CURRENCY | Annual Revenue |
| Percent | PERCENT | A Salesforce Percent field |
| Ratio as percent | RATIO_PERCENT | Show 0.25 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 type a formula returns so the Check can calculate with it. A Formula Check can set Formula Result Type to Number 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") | Type is Customer |
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.Name | Text | The parent Account’s Name |
Name & " - " & TEXT(Type) | Text | A combined value such as Acme - Customer |
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 | true 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. Leave it blank to show the generated Passes when… text based on Pass Condition.
Examples:
| Formula | Detected result type | Displayed value |
|---|---|---|
"Complete" | Text | Complete |
BillingCountry | Text | The current Billing Country |
Parent.BillingCountry | 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 | true |
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 |
|---|---|
| Automatic | AUTO (default) |
| Checkbox | BOOLEAN |
| Number | NUMBER |
| Date | DATE |
| Date/Time | DATETIME |
| Text | TEXT |
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 |
|---|---|---|
| Equals | EQUALS | One value or aggregate |
| Does not equal | NOT_EQUALS | One value or aggregate |
| Greater than | GREATER_THAN | One value or aggregate |
| Greater than or equal | GREATER_THAN_OR_EQUAL | One value or aggregate |
| Less than | LESS_THAN | One value or aggregate |
| Less than or equal | LESS_THAN_OR_EQUAL | One value or aggregate |
| Contains text | CONTAINS | Text value |
| Does not contain text | DOES_NOT_CONTAIN | Text value |
| Is empty | IS_BLANK | No Expected value needed |
| Is not empty | IS_NOT_BLANK | No Expected value needed |
| List contains any | LIST_CONTAINS_ANY | One-query list search |
| List contains none | LIST_CONTAINS_NONE | One-query list search |
| Lists overlap | LISTS_OVERLAP | Compare two query result lists |
| Lists contain all | LISTS_CONTAIN_ALL | Compare two query result lists |
| Lists match exactly | LISTS_MATCH_EXACTLY | Compare two query result lists |
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_VALUE | Expected Value (Fixed) |
| Record formula | RECORD_FORMULA | Expected Value (Formula) |
| Comparison query | COMPARISON_QUERY | Comparison Query and, when needed, Comparison Query Field |
Leave it blank for Is empty, Is not empty, 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. 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.BillingCity | Text | The parent Account’s Billing City |
5 | Number | The number 5 |
BLANKVALUE(Parent.AnnualRevenue, 0) | 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)”Required restricted picklist for Query and Compare two queries Checks.
| Setup choice | Stored value | Meaning |
|---|---|---|
| One row or aggregate | ONE_RESULT | Read one row, COUNT(), SUM(), or another aggregate. This is the default. |
| Any record passes | ANY_ROW_PASSES | The Check passes when at least one returned record matches. |
| Every record passes | ALL_ROWS_PASS | The Check passes only when every returned record matches. |
| Compare as lists | COMPARE_AS_LISTS | 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_TO_EVALUATE | 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_RECORD | Leave that returned record out of the comparison. |
| Treat as blank | AS_BLANK | Compare the value as blank text. |
| Treat as not matching | AS_NO_MATCH | 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.
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. 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_RECORDS | Nothing; this is the default. |
| When a formula is true | WHEN_FORMULA_TRUE | Applies When (Formula) |
| When a count query matches | WHEN_COUNT_QUERY_MATCHES | 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.
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. Example: ISPICKVAL(Type, "Customer").
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.
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_EQUALS |
| Greater than | GREATER_THAN |
| At least | GREATER_THAN_OR_EQUAL |
| Less than | LESS_THAN |
| At most | LESS_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.
Prerequisite Check (PrerequisiteCheck__c)
Section titled “Prerequisite Check (PrerequisiteCheck__c)”Optional Text(255). Enter the 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; dependency scheduling runs it first.
During a complete Check Set run, any prerequisite result other than PASS makes this Check
SKIPPED. A missing, inactive, misspelled, or omitted prerequisite is also skipped
with the Check Set dependency result; run Check Set validation to find the configuration error.
A single-Check request evaluates only the selected Check. Lightning single-Check, Flow Run Record
Health Check, Agent, and Apex RecordHealthCheckRequest.forCheck(...) calls therefore do not load
or enforce this dependency. Use a Check Set request whenever prerequisite ordering is required.
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 an Apex class that implements
rhc.RecordHealthCheckPlugin.
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.
Lifecycle events
Section titled “Lifecycle events”Publish User Result Event (PublishUserResultEvent__c)
Section titled “Publish User Result Event (PublishUserResultEvent__c)”Checkbox, cleared by default. It applies only when a person clicks Run or Rerun on the Lightning card.
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, Future, Scheduled Apex, or agent runs.
Those callers choose NONE, ACTIONABLE, or ALL when they start the health check. For example,
ALL publishes every result even when this checkbox is cleared.
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 Choose whether to publish result events.