Skip to content

Data model

This architecture reference shows the framework entities and relationships.

This page explains what the package stores, what exists only while a Check runs, and what your team must create if the org needs health-check history or reports.

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

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 of an earlier 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

Salesforce runs Billing_State_Valid only when Billing_Country_Present returns PASS. A missing, later, or circular prerequisite is reported by the Check Set validation and produces the documented result when the Check runs. 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, then add the fields your process needs, such as:

Create the object from Setup → Object Manager → Create → Custom Object. Add only the fields your reporting requirement needs, configure field-level security, create a tab or report type when users require one, and use the Flow action to map returned result fields into a Create Records element. These are customer-owned components and are not installed by the package.

Example custom fieldSuggested API nameValue to save
Checked Record IDChecked_Record_Id__cresult.evaluation.recordId
Check API NameCheck_API_Name__cresult.evaluation.checkQualifiedApiName
StatusStatus__cresult.evaluation.status
Reason CodeReason_Code__cresult.evaluation.reasonCode
SeveritySeverity__cresult.evaluation.severity
Run IDRun_Id__cresponse.runId

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
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 Lifecycle 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