Skip to content

Data model

Reference5 min read

Learn what Record Health Check stores in a Salesforce org, what exists only while a Check runs, and what your team must create when the org needs a history of results or reports on them.

Custom Metadata is deployable configuration, not business data. You manage these definitions from Setup → Custom Metadata Types → Manage Records; they do not appear as Account-style tabs or create a result-history table.

Record Health Check stores its configuration in two Custom Metadata Types:

Custom Metadata TypeWhat one record represents
Record Health Check Set (Record_Health_Check_Set__mdt)A group of Checks for one Salesforce object and the way its Lightning card behaves
Record Health Check (Record_Health_Check__mdt)One data-quality question, how to evaluate it, and what to show when it passes, fails, is skipped, or cannot be evaluated

The package also installs one custom object, Record Health Check Readiness (Record_Health_Check_Readiness__c). When an administrator previews a draft Check in the Record Health Check Preview component and requests a receipt, the package saves one record in it. A receipt stores identities and result counts, never record values, and expires after 30 days. See Readiness receipts.

Every Check must belong to one Check Set through the required Check Set (Record_Health_Check_Set__c) Custom Metadata relationship. A Check Set can contain many Checks.

Text fallback: one Check Set contains zero or more Checks. Every Check belongs to exactly one Check Set.

For the purpose of every field, see Check Set fields and Check fields.

Prerequisite Check (PrerequisiteCheck__c) is an optional text field on a Check. Enter the Developer Name (Record Health Check Name) of another active Check in the same Check Set. Do not enter its Check Title or Qualified API Name.

Example:

CheckDeveloper NameEvaluation OrderPrerequisite Check
Billing country is presentBilling_Country_Present10Leave blank
Billing state is validBilling_State_Valid20Billing_Country_Present

When the whole Check Set runs, Record Health Check runs Billing_Country_Present first and runs Billing_State_Valid only when it returns PASS; otherwise Billing_State_Valid is SKIPPED. The prerequisite runs first whatever the two Evaluation Order values are; a lower value only shows it higher on the card. Configuration validation reports a missing or circular prerequisite as an error. See Reason Codes: Applicability and prerequisites.

A health-check result is not saved as a Salesforce record automatically. Apex, Flow, Batch Apex, and the Lightning component receive the result for the current run. After that transaction ends, the package has no result-history record to query or report on.

The package does not install a Record_Health_Check_Result__c custom object or a result-history related list.

Section titled “Recommended: Save returned results when history is required”

If users need reports, trends, or a permanent audit history, your team must first create a custom object for that purpose. For example, create Health Check Result with API name Health_Check_Result__c, with fields such as these. The values use the Apex API’s names; the Flow actions return Status, Reason Code, and the counts as outputs.

Example custom fieldSuggested API nameTypeValue to save
Checked Record IDChecked_Record_Id__cText(18)result.evaluation.recordId
Check API NameCheck_API_Name__cText(80)result.evaluation.checkQualifiedApiName
StatusStatus__cText(30)result.evaluation.status
Reason CodeReason_Code__cText(80)result.evaluation.reasonCode
SeveritySeverity__cText(20)result.evaluation.severity
Run IDRun_Id__cText(120)response.runId

Create the object from Setup → Object Manager → Create → Custom Object. Add only the fields your reporting requirement needs, configure field-level security, and create a tab or report type when users require one. Then save the results from Apex, or from a Flow with a Create Records element after the Flow action.

The object and field names above are examples; they are not installed by Record Health Check. Save the returned values in your Flow or Apex process. For a complete Batch Apex example, see Batch Apex.

Use Platform Events when a separate Flow, Apex trigger, or external integration should receive the results after the run. Publishing an event does not create a reportable history record. The receiver must save the fields to an object if long-term storage is required.

Platform EventWhat one event describes
Record_Health_Check_Result__eOne Check result for one checked record
Record_Health_Check_Set_Run__eThe final Status counts for one checked record and Check Set, or the end of a Batch, Queueable, or Scheduled job
Record_Health_Check_Log__eRestricted troubleshooting detail for an ERROR log entry

Programmatic Apex and Flow runs choose NONE, ACTIONABLE, or ALL. A person clicking the Lightning card’s Run or Rerun button uses the two publication settings in Custom Metadata. Automatic record-page checks do not publish health-result events. Error Log events have their own Check Set setting. See Decide when to use Platform Events before creating a receiver.

DataExists after installation?Saved by the package after each run?
Check Sets and ChecksYes, as Custom MetadataNot applicable; these records are configuration
Apex or Flow responseOnly during the requestNo
Lightning card resultOnly in the current component stateNo
Platform Event messageOnly when publication is enabled or requestedNo custom-object history is created
Your team’s result custom objectOnly if your team creates itYes, when your Flow or Apex code inserts a record