Data model
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.
What the package stores
Section titled “What the package stores”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 Type | What one record represents |
|---|---|
Record Health Check Set (Record_) | A group of Checks for one Salesforce object and the way its Lightning card behaves |
Record Health Check (Record_) | 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.
erDiagram
CHECK_SET ||--o{ CHECK : "contains"
CHECK_SET {
string QualifiedApiName
string ObjectApiName
boolean IsActive
string CardRunMode
string CardRevealMode
string PassedChecksDisplay
string SkippedChecksDisplay
string FoundExpectedDisplay
string SummaryDisplay
boolean ShowDiagnostics
}
CHECK {
string QualifiedApiName
string EvaluationType
integer EvaluationOrder
string PrerequisiteCheck
string ComparisonOperator
string FailureSeverity
string Category
}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.
How prerequisite Checks are connected
Section titled “How prerequisite Checks are connected”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:
| Check | Developer Name | Evaluation Order | Prerequisite Check |
|---|---|---|---|
| Billing country is present | Billing_ | 10 | Leave blank |
| Billing state is valid | Billing_ | 20 | Billing_ |
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.
What happens to a result
Section titled “What happens to a result”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.
Recommended: Save returned results when history is required
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 field | Suggested API name | Type | Value to save |
|---|---|---|---|
| Checked Record ID | Checked_ | Text(18) | result. |
| Check API Name | Check_ | Text(80) | result. |
| Status | Status_ | Text(30) | result. |
| Reason Code | Reason_ | Text(80) | result. |
| Severity | Severity_ | Text(20) | result. |
| Run ID | Run_ | Text(120) | response. |
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.
Optional: Publish Platform Events
Section titled “Optional: Publish Platform Events”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 Event | What one event describes |
|---|---|
Record_ | One Check result for one checked record |
Record_ | The final Status counts for one checked record and Check Set, or the end of a Batch, Queueable, or Scheduled job |
Record_ | Restricted 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.
What is metadata and what is run data?
Section titled “What is metadata and what is run data?”| Data | Exists after installation? | Saved by the package after each run? |
|---|---|---|
| Check Sets and Checks | Yes, as Custom Metadata | Not applicable; these records are configuration |
| Apex or Flow response | Only during the request | No |
| Lightning card result | Only in the current component state | No |
| Platform Event message | Only when publication is enabled or requested | No custom-object history is created |
| Your team’s result custom object | Only if your team creates it | Yes, when your Flow or Apex code inserts a record |