Loading

Energy Service Agreement Record Creation Fails with "Entity is not API accessible" or "sObject type 'EnergyServiceAgreement' is not supported" When Apex Runs on API Version 57.0 or Lower

Publiceringsdatum: Oct 24, 2026
Beskrivning

The EnergyServiceAgreement object is only accessible through API version 58.0 or higher. If a record is created or accessed from code running on API version 57.0 or lower, the request fails with errors such as "Entity is not API accessible" or "sObject type 'EnergyServiceAgreement' is not supported with v57". This can happen even when the Apex trigger itself is on a current version, because the failing code may be a class or subclass called from the trigger that is still pinned to an older API version. The behavior can also appear in one org but not another, for example in a sandbox that has a custom trigger or helper class that production does not have.

Lösning

1. Reproduce the error with the same user and note the exact message. You can also confirm the version limit by querying the object through Workbench or Salesforce Inspector at API version 57.0 and again at 58.0 or higher.
2. In Setup, review any custom Apex triggers on the Energy Service Agreement object. Temporarily deactivating a trigger in a sandbox can help confirm whether it is the source.
3. Open the classes the trigger calls, including subclasses and helper classes, and check each class's API version.
4. Update any class on API version 57.0 or lower to a current version, for example 66.0.
5. Save, then retry creating the Energy Service Agreement record.
6. Re-enable the trigger and re-test, then compare against production to confirm the behavior matches.

Knowledge-artikelnummer

005465238

 
Laddar
Salesforce Help | Article