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.
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.
005465238

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.