TopicsForObjects controls whether users can assign topics to records of a particular object or remove topic assignments. It defines object-level topic enablement, not the topics themselves or the assignments between topics and individual records.
Each component identifies one object through entityApiName. Its required enableTopics setting controls assignment and removal together; it does not provide separate switches for the two operations.
Key Elements
| Element | What the Element Controls |
|---|---|
enableTopics |
Required boolean. true enables users to assign topics and remove topic assignments. false prevents both operations. Disabling topics is not a request to clear existing assignments. |
entityApiName |
Required string. Identifies the affected standard or custom object by its API name, such as Account. |
Behavior and Constraints
enableTopics is a combined control. Setting it to false prevents users from removing topic assignments as well as adding them. This type cannot express "allow removal but prevent assignment."
At org creation, enableTopics is true for Account, Asset, Campaign, Case, Contact, Content Document, Contract, Event, Lead, Opportunity, Order, Solution, and Task. It defaults to false for all remaining standard objects and custom objects.
These are org-creation defaults, not a description of an existing org's current configuration. They also do not establish reset behavior when a component is omitted from a deployment. Do not treat disabling topics as an instruction to delete existing record-topic assignments.
Deployment and Retrieval
In Metadata API package format, components reside in the topicsForObjects directory and use the .topicsForObjects suffix. The component naming pattern is <objectName>, so an Account component has the file name Account.topicsForObjects.
The entire file base, meaning the name after removing the directory and metadata extension, identifies the associated object. Preserve the complete name, including any namespace. The object association alone does not require deploying the object definition and its TopicsForObjects component together or establish a deployment order.
TopicsForObjects supports the * wildcard in package.xml, the manifest that selects metadata components. To select this type with a wildcard, use <members>*</members> with <name>TopicsForObjects</name>.
To configure an object with topics disabled, supply its API name in entityApiName and set enableTopics to false. This changes the enablement setting; it is not an assignment-cleanup operation. Package eligibility is a separate concern from object-level topic enablement, as described in the reported issue below.
Relationships
TopicsForObjects connects to an object's metadata through an element reference and a separate component-name association. In this context, CustomObject can represent a standard object as well as a custom object.
References
-
CustomObject:entityApiName.
Name-based association: The complete TopicsForObjects component file base identifies the associated CustomObject object name. This naming association does not prove that an associated component exists in a particular org, require joint deployment, or authorize deleting either component.
Reported Issues
- A packaging-org deployment was reported to fail because the package contained this type. In April 2020, an author reported the error "You cannot install or upgrade a package that has a TopicsForObjects component." Topics were enabled on a custom object, and the failure occurred during Metadata API deployment after source conversion. The author relayed Salesforce Support's explanation that the type was not packageable and reported excluding the component from the package as a workaround. This is a dated packaging-context report, not a general prohibition on Metadata API deployment or proof that every packaging mechanism still requires that workaround. See the packaging deployment report.
Common Questions
Does disabling topics remove existing topic assignments?
Do not treat it as a cleanup operation. Setting enableTopics to false prevents users from both assigning topics and removing assignments.
Can I allow users to remove topics but prevent them from adding topics?
Not through TopicsForObjects. The single enableTopics setting controls both operations together.
How do I retrieve TopicsForObjects with package.xml?
Select TopicsForObjects as the type name. The type supports <members>*</members> for wildcard selection.
Do I have to deploy CustomObject with TopicsForObjects?
The reference and naming association do not, by themselves, require joint deployment. entityApiName identifies the affected object's API name.
Why does a package deployment reject TopicsForObjects?
The April 2020 report attributed that failure to package eligibility, not to whether topics were enabled on the object. Excluding the component was the reported workaround, but the report does not establish the behavior of every current packaging mechanism.