Loading

Health Cloud: HealthCloudGA triggers fail with "Dependent class is invalid and needs recompilation: Invalid type: ContactEncounterParticipant"

Publish Date: May 27, 2026
Description

This article explains why HealthCloudGA managed-package Apex triggers fail to compile and how to resolve the resulting record-creation block.

When creating a Lead, Case, Contact, Account, or Account Contact Relationship, you receive one of the following errors:

"HealthCloudGA.LeadTrigger: execution of BeforeInsert caused by: line 5, column 9: Dependent class is invalid and needs recompilation: Class HealthCloudGA.HcLeadTriggerHandler : Dependent class is invalid and needs recompilation: Class HealthCloudGA.HcLeadService : Dependent class is invalid and needs recompilation: Class HealthCloudGA.ERMLeadService : Invalid type: ContactEncounterParticipant"

"HealthCloudGA.HcCaseTrigger: execution of AfterInsert caused by: ... Dependent class is invalid and needs recompilation: Class HealthCloudGA.HcCaseTriggerHandler : Dependent class is invalid and needs recompilation: Class HealthCloudGA.HcCarePlanService : ... : Field is not writeable: ContactEncounterParticipant.ContactId"

"HealthCloudGA.AccountContactRelationTrigger: execution of BeforeInsert caused by: ... Dependent class is invalid and needs recompilation: Class HealthCloudGA.HcAccountContactRelationTriggerHandler"

Customers describe this as: "When adding a lead I get this error... this just started out of the blue" and "Users cannot create Cases because of a Health Cloud managed package Case trigger that is failing and I cannot disable it."

Root cause: The HealthCloudGA managed-package Apex classes reference the ContactEncounterParticipant standard object. Access to this object is gated by Health Cloud Permission Set Licenses (PSLs), specifically "Contact Center for Health Cloud". When these PSLs expire, are disabled, or are otherwise removed from the org, the ContactEncounterParticipant object is no longer available, the dependent Apex classes become invalid, and every DML operation that fires a HealthCloudGA trigger (Lead BeforeInsert, Case AfterInsert, AccountContactRelation BeforeInsert, etc.) is blocked.

Affected scope: Salesforce orgs (Production and Sandbox) with the HealthCloudGA managed package installed where Health Cloud PSLs have expired or been disabled. All user profiles are affected — the trigger fails before profile-level checks.

Resolution

Use the cause that matches your situation. Cause 1 applies if you have ever held Health Cloud licenses and they have expired or been disabled. Cause 2 applies only if the Apex classes are stale due to a recent deployment but the Health Cloud PSLs are still active.

Cause 1: Health Cloud Permission Set Licenses are expired or disabled (most common)

  1. Confirm the license state. From Setup, enter "Company Information" in the Quick Find box and select Company Information. Scroll to the Permission Set Licenses related list and locate "Contact Center for Health Cloud" and any other Health Cloud PSL (for example, "Health Cloud Foundation", "Health Cloud Starter"). Note the Status and Expiration Date.
  2. Confirm the missing object. From Setup, enter "Object Manager" in the Quick Find box and select Object Manager. Search for "Contact Encounter Participant" [ContactEncounterParticipant]. If the object is not listed, the PSL gating it has been removed.
  3. Decide between reinstating licenses or uninstalling the managed package:
    1. To keep Health Cloud, contact your Salesforce Account Executive and request reactivation of the "Contact Center for Health Cloud" Permission Set License. A 30-day courtesy license can be requested while procurement completes. Once the PSL is reactivated, the ContactEncounterParticipant object becomes available again and the dependent classes recompile automatically on next access.
    2. To remove Health Cloud, uninstall the HealthCloudGA managed package (see Cause 1b steps below).
  4. After license reactivation, recompile the managed-package classes to clear the cached invalid state. Navigate to Setup > Custom Code > Apex Classes and click "Compile all classes".

Cause 1b: Uninstalling the HealthCloudGA managed package (when not renewing)

  1. Refresh a Full Sandbox and validate the uninstall there before touching production.
  2. In the sandbox, navigate to Setup > Object Manager and identify every page layout, Lightning record page, flow, process, Apex class, and report that references Health Cloud objects, record types, or fields (for example, CarePlan, ContactEncounterParticipant, HealthCloudGA.* classes).
  3. Reassign records that use Health Cloud record types to standard record types. Deactivate or rebuild flows that reference HealthCloudGA Apex classes or Health Cloud fields.
  4. Navigate to Setup > Apps > Packaging > Installed Packages. Locate "Health Cloud" (namespace HealthCloudGA) and click Uninstall.
  5. On the uninstall confirmation page, select "Save a copy of this package's data for 48 hours after uninstall" so you can recover if needed, then click Uninstall.
  6. Repeat the validated procedure in production during a maintenance window.

Cause 2: Apex classes invalidated by a deployment or package upgrade (PSLs still active)

Use this path only if the ContactEncounterParticipant object is visible in Object Manager.

  1. Navigate to Setup > Custom Code > Apex Classes.
  2. Click "Compile all classes". Wait for the compilation to complete.
  3. Navigate to Setup > Custom Code > Apex Triggers and review the HealthCloudGA triggers (LeadTrigger, HcCaseTrigger, AccountContactRelationTrigger). Confirm they show as Active with no compile errors.

Verification

Confirm the issue is resolved by attempting to create a new Lead from the Leads tab and a new Case from the Cases tab in the affected org. Both records must save without the "Dependent class is invalid and needs recompilation" error. If you create Account Contact Relationships, also create a new individual or business contact to confirm the AccountContactRelationTrigger compiles.

Knowledge Article Number

005385194

 
Loading
Salesforce Help | Article