TopicAssignment

Represents the assignment of a topic to a specific feed item, record, or file.

Administrators must enable topics for objects before users can add topics to records of that object type. Topics for most objects are available in API version 30.0 and later. Topics for ContentDocument are available in API version 37.0 and later.

Introduced in API version 28.0.

create(), describeSObjects(), delete(), getDeleted(), getUpdate(), query(), retrieve()

  • Type: string

  • Properties: Filter, Group, idLookup, Sort

  • Introduced: API version 32.0

  • Description:

    The first three digits of the EntityID field, which identify the object type (account, opportunity, etc). This read-only field is available in API version 32.0 and later.

    Interface label is “Record Key Prefix,” which appears only in reports.

  • Type: string

  • Properties: Filter, Group, Nillable, Sort

  • Introduced: API version 33.0

  • Description:

    The standard name for the object type (account, opportunity, etc). This read-only field is available in API version 33.0 and later.

    Interface label is “Object Type,” which appears only in reports.

    Querying topic assignments for the ManagedContentVersion entity type isn’t supported.

    In most cases, you should use this field rather than EntityKeyPrefix, which exists primarily to support older reports.

  • Type: reference
  • Properties: Create, Filter, Group, Nillable, Sort
  • Description: Identifier of the community to which the TopicAssignment belongs. This field is available only if digital experiences is enabled in your org.
  • Relationship name: Network
  • Relationship type: relationship
  • Refers to: Network
  • Type: reference

  • Properties: Create, Filter, Group, Sort

  • Description:

    Identifier of the topic.

    This is a relationship field.

  • Relationship name: Topic

  • Relationship type: relationship

  • Refers to: Topic

Use this object to query the assignments of topics to feed items, records, or files. To assign or remove topics, you must have the “Assign Topics” permission.

In SOQL SELECT syntax, this object supports nested semi-joins, allowing queries on Knowledge articles assigned to specific topics. For example:

There is no SOQL limit if the logged-in user has the “View All Data” permission. If they do have that permission, do one of the following:

  • Specify a LIMIT clause of 1,100 records or fewer.
  • Filter on Id or Entity when using a WHERE clause with ”=”.

Deleting this object’s records removes all its data. This action is irreversible.

When you create a report type on the TopicAssignment object, all queries are generated in SQL, which does not enforce the 1,100 record limit clause.