Skip to content

Package Apex implementation reference

Detailed page. Use “On this page” to jump directly to the section you need.

Use this reference to locate the production Apex class responsible for a package behavior while changing or reviewing the repository source. These classes are implementation details, not public Apex APIs for subscriber code.

Use this page when locating an internal Apex implementation class. This class-level reference is not a Setup or Flow walkthrough. Administrators should use the Flow, configuration, and evaluation guides; subscriber developers should use the public Apex API or Apex Check contract.

Find the production Apex class responsible for an internal Record Health Check behavior. Use this while reading or changing the package source. Writing a custom Apex Check? Start with Apex Check contract, not this folder.

Find every production class under packages/record-health-check/force-app/main/default/classes/ (excluding *Test classes and coverage helpers). The Apex Check installed with the package and the examples used only by repository integration tests are identified separately in Results, definitions, and plugins.

This is an internal package-maintenance catalog. It is not a list of Apex APIs available to custom code in your org. After installing the namespaced unlocked package, a top-level public class can be used only by other classes inside the package. Apex created in your org can call only the global types documented by the Apex API and Apex Check contract.

Unless noted otherwise, Record Health Check service classes are public with sharing. Result and definition data holders, the plugin interface, merge-token helpers, and a few other types are plain public classes (no sharing keyword) because they hold data or interfaces rather than query Salesforce records.

The current source contains 350 packaged Apex classes, including 164 @IsTest classes and 2 global contract-test support class. Tests and contract support cover dynamic SOQL, formulas, metadata validation, security boundaries, bulk execution, asynchronous entry points, integrations, and failure diagnostics; those classes verify behavior rather than run ordinary health checks.

The class and test counts are checked automatically by npm run check:docs. Physical line counts are intentionally omitted because they change with implementation and documentation comments and are not a supported package contract.

The L5 through L1 labels describe which internal classes can call which other classes. L5 receives requests from Lightning, Flow, or Apex and calls lower layers. L1 holds results, requests, and public contracts and does not call back into the higher layers. These labels are not package versions or steps an administrator must learn.

StepLayerPage
1L5 Entry pointsEntry points
2L4 Scope orchestrationScope orchestration
3L3 EvaluatorsEvaluators
4L2 Configuration and validationConfiguration and validation
5L2 Shared evaluation servicesShared services
6L2 Merge-token classesMerge-token classes
7L2-L5 Supporting classes used while a Check runsRun-support classes
8L1 Results, definitions, and pluginsResults and plugins
9Subscriber contract foundationsSubscriber foundations
10Plugin verification testPlugin verification
11Test-only access / architecture policyContributor policy: Apex test-only access
You want to…Start here
Scan classes by layerClass index by level
Understand who calls whomLayers at a glance
Read a detailed descriptionThe layer sections below
Call Record Health Check from Apex or FlowApex API or Flow actions; do not call internal classes from this folder
Implement RecordHealthCheckPluginPlugin interface classes, then Apex reference

Each detailed class entry uses the same order: its job, Apex type and sharing mode, behavior, key methods or fields, important limits, and related classes. This makes it easier to compare the documentation with the source.

Higher levels call lower levels. Lower levels never call back up. This matches Reference: Architecture § 5. Layers; the sections below use the same L5→L1 numbering so you can move between the two pages without re-deriving the mapping.

LevelLayerClasses (summary)
L5Entry pointsRecordHealthCheck, Flow actions, RecordHealthCheckController, plus lifecycle publication and run context
L4Scope orchestrationRecordHealthCheckScopePipeline, RecordHealthCheckFieldPlanner, RecordHealthCheckFormulaFieldScanner
L3EvaluatorsFormula, Query, Compare two queries, Apex evaluators + query support
L2Shared servicesConfig, validation, SOQL templates, comparison, values, merge tokens, describe cache, logger, access, constants
L1Results and definitionsResult data holders, definition responses, plugin interface and context

Configuration, shared evaluation services, and merge tokens each get their own H2 section below for readability, but all three live at L2 in the architecture layer diagram.

LevelClassOne-line purpose
L5RecordHealthCheckPublic Apex evaluate(request) API
L5RecordHealthCheckControllerAura-enabled API for the Lightning card
L5RecordHealthCheckPreviewServicePrivileged detached validation, execution Preview, and readiness evidence
L5RecordHealthCheckRunCheckFlowActionPackaged Flow action “Run Record Health Check”
L5RecordHealthCheckRunSetFlowActionPackaged Flow action “Run Record Health Check Set”
L5RecordHealthCheckRunCheckAgentActionNative Agentforce action for one exact Check and record
L5RecordHealthCheckRunSetAgentActionNative Agentforce action for one exact Check Set and record
L5RecordHealthCheckAgentRestResourceVersioned read-only REST boundary for approved agent tools
L5RecordHealthCheckAgentContractRequest rules and correlation identifiers shared by every agent surface
L5RecordHealthCheckQueueableRuns one bounded Check Set group in the background; results are not saved unless the caller publishes events or custom code saves them
L5RecordHealthCheckBatchSplits 1–2,000 explicit IDs into automatic formula-safe scopes of 1–100 records, or an explicit scope of 1–200; all share the Batch job Run ID
L5RecordHealthCheckScheduledRuns the same saved list of IDs daily by launching RecordHealthCheckBatch
L5RecordHealthCheckAsyncSupportShared validation and request construction for asynchronous adapters
L5RecordHealthCheckFlowSupportShared Flow input normalization, result alignment, and summary status logic
L5RecordHealthCheckFlowGroupExecutorShared normalized grouping and engine execution for both Flow actions
L5RecordHealthCheckLifecyclePublisherOptional Set Run and Check Result platform events
L5RecordHealthCheckEventIdUnique, bounded lifecycle-event identifier generation
L5RecordHealthCheckValidateMetadataActionAdministrator Flow action for configuration validation
L5RecordHealthCheckRunContextRun id, source, and timing for one evaluation
L5RecordHealthCheckSetPicklistApp Builder dynamic picklist for Check Set Developer Name
LevelClassOne-line purpose
L4RecordHealthCheckScopePipelineResolves a selection and evaluates the complete ordered record scope
L4RecordHealthCheckEvaluatorRegistryMaps Evaluation Type values to a common scope evaluator contract
L4RecordHealthCheckFieldPlannerSafe record-field planning for scope evaluation
L4RecordHealthCheckFormulaFieldScannerExtracts selectable record paths from formula expressions
L4RecordHealthCheckFormulaPlanServiceProduces permission-sensitive formula tokens, dependencies, compiler diagnostics, and field plans
L4RecordHealthCheckBulkQuerySupportExecutes supported query templates once for a complete scope
L4RecordHealthCheckBulkQueryShapeIdentifies a safe direct outer-WHERE correlation
L4RecordHealthCheckBulkQueryRewriterRewrites validated query templates for scope-wide execution
L4RecordHealthCheckScopePlannerResolves selections, applicability, prerequisites, and request budgets
L4RecordHealthCheckResourcePlanCalculates formula and plugin-fence admission
L4RecordHealthCheckPrerequisiteEligibilitySelects records eligible to reach applicability
L4RecordHealthCheckScopeResultSupportConverts internal outcomes, diagnostics, display text, and safe URLs
L4RecordHealthCheckScopeDisplayFinalizerResolves display text, diagnostics and evidence using the authorized scope map
LevelClassOne-line purpose
L3RecordHealthCheckFormulaEvaluatorFormula Evaluation Type and shared formula resolution
L3RecordHealthCheckSoqlEvaluatorSingle-query Evaluation Type
L3RecordHealthCheckCompareQueriesEvaluatorCompare-two-queries Evaluation Type
L3RecordHealthCheckApexEvaluatorLoads and runs a RecordHealthCheckPlugin
L3RecordHealthCheckQueryEvaluatorSupportShared query execution and empty-result handling
L3RecordHealthCheckApexResultFinalizerFinalizes plugin outcomes without mixing result shaping into dispatch
L3RecordHealthCheckApexPluginResolverResolves validated plugin instances and bounded parameter objects
L3RecordHealthCheckCompareQuerySupportOwns compare-query row reduction and side-specific handling
L3RecordHealthCheckFormulaDisplayShapes formula evaluator Found and Expected display values
L3RecordHealthCheckFormulaSyntaxParses and validates formula-specific syntax
L3RecordHealthCheckSoqlEvaluationOwns the SOQL evaluator’s query-to-result decision path
L3RecordHealthCheckSoqlValueResolverResolves primary and comparison inputs while preserving early empty results
L3RecordHealthCheckSoqlTokenBinderPerforms safe lexical substitution in validated SOQL templates
L3RecordHealthCheckSoqlBindValueResolverResolves described field paths and coerces typed token fallbacks
LevelClassOne-line purpose
L2RecordHealthCheckConfigServiceLoads Check Sets and Checks, builds definitions, and reports configuration problems found while a Check runs
L2RecordHealthCheckValidatorShared per-Evaluation-Type Check field validation
L2RecordHealthCheckApexConfigSupportApex Check validation precedence and authoring issue taxonomy
L2RecordHealthCheckMetadataValidatorDeploy-time / CI audit of Custom Metadata
L2RecordHealthCheckConfigValidatorShared validation helpers (object names, plugins, JSON, tokens)
L2RecordHealthCheckConstantsAllowed values and numeric limits (single source of truth)
L2RecordHealthCheckReasonCodesSelected stable reason-code helpers
L2RecordHealthCheckSetAvailabilityWhether an object has active/inactive Check Sets
L2RecordHealthCheckComparisonEngineOperators, equality, empty/null behavior
L2RecordHealthCheckDisplayFormatRenders Found and Expected values for the card chips
L2RecordHealthCheckSoqlTemplateSafe SOQL preparation (WITH USER_MODE, row limit, keyword rejection)
L2RecordHealthCheckQueryPredicateProofStructural proof of required outer WHERE equality literals
L2RecordHealthCheckValueResolverExtract, convert, and compare query values
L2RecordHealthCheckDescribeCacheSchema describe cache for the current transaction
L2RecordHealthCheckEvaluatorExceptionEvaluator failure carrying a reason code
L2RecordHealthCheckAccessRun access and direct packaged diagnostics Permission Set assignment checks
L2RecordHealthCheckLogger[RHC] debug lines and ERROR log platform events
L2RecordHealthCheckDiagnosticTraceBuilds authorized Check configuration and resolution snapshots for browser diagnostics
L2RecordHealthCheckSettingsProviderResolves lifecycle and diagnostic publication settings
L2RecordHealthCheckTemplateServiceParse, validate, and resolve namespaced merge tokens and their optional fallback text
L2RecordHealthCheckTemplateValueResolverResolves namespace-specific values available while merge text is built
L2RecordHealthCheckTokenRegistryAllowed token namespaces and properties
L2RecordHealthCheckTokenOne parsed merge token
L2RecordHealthCheckTokenIssueOne token validation failure
L2RecordHealthCheckMergeContextValues available while resolving merge tokens
L2RecordHealthCheckComparisonDisplayConverts comparison operands into stable display content
L2RecordHealthCheckComparisonVisibilityResolves and validates the per-Check Found/Expected visibility setting
L2RecordHealthCheckConfigFindingMapperConverts validation findings into configuration results returned during a run
L2RecordHealthCheckDefinitionLoaderLoads and validates Lightning definition metadata
L2RHCDefinitionDependencyIdentityResolves prerequisite identity without namespace collisions
L2RecordHealthCheckDisplayCurrencyRendererRenders currency symbols and minor units
L2RecordHealthCheckDisplayCurrencyResolverResolves row and corporate currency context with transaction caching
L2RecordHealthCheckDisplayFieldResolverExtracts display values from described field paths
L2RecordHealthCheckDisplayNumberRendererRenders numeric and percentage display formats
L2RecordHealthCheckDisplayTextRendererRenders textual and blank display values
L2RHCMetadataDependencyValidatorValidates prerequisite references and dependency cycles
L2RecordHealthCheckMetadataIssueMapperMaps validator findings to deploy-time issues
L2RecordHealthCheckMetadataSetValidatorValidates Check Set identity and set-level fields
L2RecordHealthCheckTemplateParserParses namespaced merge tokens independently of resolution
LevelClassOne-line purpose
L1RecordHealthCheckScopeThe records a custom Check is asked about, plus its parameters. Read-only
L1RecordHealthCheckOutcomeWhat a custom Check returns for one record: a verdict and its values
L1RecordHealthCheckValueA typed Found or Expected value with one stored format per data type
L1RecordHealthCheckDisplayGroupComposes one keyed label/item row for structured Apex display
L1RecordHealthCheckDisplayTextBuilds bounded text, links, breaks, record lists, and ordered groups
L1RecordHealthCheckDisplayActionCarries one optional plugin-authored remediation label and destination
L1RecordHealthCheckDisplayOverrideCarries optional plugin presentation without changing evaluation or administrator policy
L1RecordHealthCheckEvaluationResultMachine-readable status, identity, reason, and typed values
L1RecordHealthCheckResultDisplayOptional human-facing rendering derived from evaluation data
L1RecordHealthCheckResultItemEvaluation data plus optional display content
InternalRecordHealthCheckInternalResultPackage-only evaluator handoff used before the public result split
L1RecordHealthCheckSelectionRequires exactly one qualified Check name or one qualified Check Set name
L1RecordHealthCheckQualifiedIdentityShared trim and length validation for qualified metadata identities
L1RecordHealthCheckOptionsResult, publication, and run correlation options
L1RecordHealthCheckExecutionOriginTyped caller attribution for lifecycle events
L1RecordHealthCheckRequestQualified selection and detached record scope
L1RecordHealthCheckResponseShared Check and Check Set response envelope
L1RecordHealthCheckRunSummaryTerminal status counts for one response
L1RecordHealthCheckContractTestExtensible plugin verification test for bulk growth and forbidden writes
L1RecordHealthCheckContractTestDataPlugin-author supplied scopes and controlled least-privilege test data
L1RecordHealthCheckStatusThe status values: PASS, FAIL, SKIPPED, UNABLE_TO_EVALUATE, ERROR
L1RecordHealthCheckResultModeSelects how much data a result carries
L1RecordHealthCheckEventPublicationWhether a programmatic run publishes lifecycle Platform Events
L1RecordHealthCheckPluginDispatchRuns a custom Check and verifies that it did not change Salesforce records, make callouts, send email, publish events, or start asynchronous work
L1RecordHealthCheckPluginDefinitionSourceOptional typed plugin-parameter and capacity declaration contract
L1RecordHealthCheckEvidenceTyped, bounded evidence returned by an Apex Check
L1RecordHealthCheckRecordEvaluatorPer-record plugin recovery extension used with RecordHealthCheckOutcome.tryEvaluate
L1RecordHealthCheckReadinessServiceSaves, decorates, verifies, and expires private Preview readiness evidence
L1RecordHealthCheckDisplayPluginOptional presentation-only plugin extension
L1RecordHealthCheckPresentationResolverResolves plugin display output with per-field metadata fallback
L1RecordHealthCheckDefinitionOne Check row in the Lightning definition response
L1RecordHealthCheckDefinitionResponseCheck Set display settings + ordered Check definitions
L1RecordHealthCheckAdminDetailStructured diagnostics detail on a Check result
L1RecordHealthCheckValueSourceStructured Found/Expected diagnostic detail
L1RecordHealthCheckPluginInterface every Apex evaluator plugin implements
LevelClassOne-line purpose
ExampleAccountHasRecentActivityCheckShipped Apex Check: recent Task/Event activity on an Account