Skip to main content

'Entity of type X named Y cannot be found' in Salesforce

Updated · By the Clientell AI team · How we write

A retrieve or pull asked for a component that the org does not have under that name. Check the spelling, the type, whether someone renamed or deleted it, and whether you point at the right org. The retrieve can still report success, so read the messages list. A destructive deploy of a missing component only warns.

Error text

Entity of type 'ApexClass' named 'LegacyQuoteHelper' cannot be found

Message reproduced with a check-only deploy to a Salesforce developer org on Nov 4, 2026.

A retrieve with the same manifest prints the message at once. A check-only deploy of destructive changes prints a warning of the same kind. No deploy is needed to find it.

What does "Entity of type cannot be found" mean?

You asked the org for a component by type and name, and it has none. This is mostly a retrieve message, so it shows up when you pull source, run a retrieve against a manifest, or sync a project. It is not a deploy failure.

A retrieve of a class that does not exist puts this in the messages list of the result:

Entity of type 'ApexClass' named 'LegacyQuoteHelper' cannot be found

The result status of that retrieve was Succeeded. A script that only checks the status will think everything came down, and the file is not there.

What causes it?

  • A typo in the member name, or the wrong type for that name. People have hit the message for a CustomApplication named Case, which is an object name used under the wrong type (Salesforce Stack Exchange).
  • Someone deleted or renamed the component in the org after your manifest or source tracking was written. The same message is reported for list views during a pull (Salesforce Stack Exchange).
  • The component belongs to a feature this org does not have. A record type named Account.Business_Account produced the message for someone using Person Accounts (Salesforce Stack Exchange).
  • You are pointed at the wrong org. A production alias in place of a sandbox is common.

What is the matching message on a destructive deploy?

If you delete a component through destructiveChanges.xml and the component is already gone, Salesforce does not fail. It warns:

destructiveChanges.xml | Warning | No ApexClass named: OldQuoteCleanup found

A check-only run returns a warning on the destructive file, not an error. Treat it as the same signal: the name you gave does not exist in that org.

How do I fix it in Setup?

  1. Find the component by hand. Open Setup and look in the place that type lives, for example Apex Classes or Object Manager, Record Types.
  2. If it is there, copy the exact API name. Check capitals, underscores and the __c ending.
  3. If it is not there, find out who removed it. Setup, View Setup Audit Trail lists recent changes to the org.
  4. Fix the manifest or source, or recreate the component.

How do I fix it with the CLI?

Confirm which org you are on, then list what exists for that type:

sf org display -o target-org
sf org list metadata --metadata-type ApexClass -o target-org

Compare the output with your manifest. Remove members that are not there, then retrieve again and read the messages as well as the status. For source tracking problems, a reset of the tracking files is sometimes needed, but check the name first.

How do I avoid it?

Generate manifests from the project rather than writing them by hand. Run the retrieve in a job and fail the job if the messages list holds an entity-not-found line. See package.xml errors for the deploy-side twin of this error. The Salesforce glossary explains why sandboxes drift from production, and AI Salesforce deployments compares two orgs so you see what exists where before you build a bundle.

Questions about entity not found

Is this a deploy error?

Usually not. It appears on retrieve and pull. The deploy-side version is a manifest message, like was named in package.xml but was not found.

Why does my retrieve say Succeeded?

The retrieve itself worked. The missing component is reported in the messages list, which is easy to skip.

Does it matter that a destructive change only warns?

It is fine when the goal is that the component is gone. It also hides a typo in the name, so read the warning.

Can a wrong org cause this?

Yes, and it is the first thing to rule out. Run sf org display and confirm the alias points where you think it does.

Catch this before the deploy window

Clientell AI runs these checks on the bundle before the deploy, and asks before it changes anything in production. Platform deployments include a snapshot and rollback.

Sources: Salesforce Stack Exchange, SFDX pull error: Entity of type ListView named XXX cannot be found, Salesforce Stack Exchange, Entity of type CustomApplication named Case cannot be found, Salesforce Stack Exchange, Entity of type RecordType named Account.Business_Account cannot be found.

All Salesforce deployment errors or paste your own error into the explainer