Newer Version Available

This content describes an older version of this product. View Latest

PlatformEventChannelMember

Represents an entity selected for Change Data Capture notifications on a standard or custom channel, or a platform event selected on a custom channel.

This object is available in API version 47.0 and later.

Supported SOAP Calls

create(), delete(), describeSObjects(), query(), retrieve(), update()

Supported REST HTTP Methods

DELETE, GET, HEAD, PATCH, POST, Query

Special Access Rules

  • To retrieve or query this object, you must have the View Setup and Configuration permission.
  • To create, update, or delete this object, you must have the Customize Application permission.
  • The EventChannel and SelectedEntity fields can’t be updated.

Fields

Field Name Description
DeveloperName
Type
string
Properties
Filter, Group, Sort
Description
The unique name for the PlatformEventChannelMember object.
This name can contain only underscores and alphanumeric characters, and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores. This field is automatically generated, but you can supply your own value if you create the record using the API.
The developer name is in the format ChannelName_EventName. If your channel member name contains a custom channel name to make it unique, ensure to replace the double underscores in the name with one underscore. For example, the developer name of a member of the MyChannel__chn custom channel is MyChannel_chn_AccountChangeEvent. And the developer name of a member of the default standard channel is ChangeEvents_AccountChangeEvent.
  • When creating large sets of data, always specify a unique DeveloperName for each record. If no DeveloperName is specified, performance slows down while Salesforce generates one for each record.
  • Only users with View DeveloperName OR View Setup and Configuration permission can view, group, sort, and filter this field.

Note

EventChannel
Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
The name of a channel. For the standard channel, the name is ChangeEvents. For a custom channel, the name is in this format: MyChannel__chn.
FilterExpression
Type
textarea
Properties
Nillable
Description

This feature is a Beta Service. Customer may opt to try such Beta Service in its sole discretion. Any use of the Beta Service is subject to the applicable Beta Services Terms provided at Agreements and Terms.

Note

An expression that is used to filter the stream of events and deliver only the events that match specific criteria. The filter expression can contain one or more field-value expressions. The filter expression format is based on SOQL and supports a subset of SOQL operators and field types.
For example, this filter expression delivers only events that contain the City__c field with a value of 'San Francisco'. City__c = 'San Francisco'
For more information, see Filter Your Stream of Platform Events with Channels (Beta) in the Platform Events Developer Guide. Available in API version 54.0 and later.
FullName
Type
string
Properties
Create, Group, Nillable
Description
The full name of the associated PlatformEventChannelMember object in Metadata API. The full name is in the format ChannelName_EventName and can include a namespace prefix.
Two consecutive underscores in full names designate either a component name suffix or a namespace prefix. In all other cases, two consecutive underscores aren’t supported in full names. If your channel member name contains a custom channel name to make it unique, be sure to replace the double underscores in the name with one underscore. For example, the member name would be MyChannel_chn_AccountChangeEvent and not MyChannel__chn_AccountChangeEvent.
Query this field only if the query result contains no more than one record. Otherwise, an error is returned. If more than one record exists, use multiple queries to retrieve the records. This limit protects performance.
Language
Type
picklist
Properties
Defaulted on create, Filter, Group, Restricted picklist, Sort
Description
The language of the MasterLabel.
ManageableState
Type
ManageableState enumerated list
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
Indicates the manageable state of the specified component that is contained in a package:
  • beta
  • deleted
  • deprecated
  • deprecatedEditable
  • installed
  • installedEditable
  • released
  • unmanaged
Metadata
Type
complexvalue
Properties
Create, Nillable, Update
Description
Platform event channel member metadata.
Query this field only if the query result contains no more than one record. Otherwise, an error is returned. If more than one record exists, use multiple queries to retrieve the records. This limit protects performance.
NamespacePrefix
Type
string
Properties
Filter, Group, Nillable, Sort
Description
The namespace prefix that is associated with this object. Each Developer Edition org that creates a managed package has a unique namespace prefix. Limit: 15 characters. You can refer to a component in a managed package by using the namespacePrefix__componentName notation.

The namespace prefix can have one of the following values.

  • In Developer Edition orgs, NamespacePrefix is set to the namespace prefix of the org for all objects that support it, unless an object is in an installed managed package. In that case, the object has the namespace prefix of the installed managed package. This field’s value is the namespace prefix of the Developer Edition org of the package developer.
  • In orgs that aren’t Developer Edition orgs, NamespacePrefix is set only for objects that are part of an installed managed package. All other objects have no namespace prefix.
SelectedEntity
Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
The change event name of an entity selected for Change Data Capture notifications. For example, for the Account standard object, the name is AccountChangeEvent, or for a custom object MyObject__c, the name is MyObject__ChangeEvent.

Usage

This JSON example is the body of a REST API POST request. It adds a member to a custom channel named MyCustomChannel__chn. The corresponding REST endpoint is /services/data/v54.0/tooling/sobjects/PlatformEventChannelMember.

To add a member to the ChangeEvents default channel, the request body looks as follows.

You can query PlatformEventChannelMember in SOQL over Tooling API. For example, this query returns fields of all channel members on all channels.

For custom channels, the EventChannel value that the query returns is the channel ID, which starts with the 0YL prefix.

Note

You can configure a channel member to include extra fields in change events as part of Change Data Capture Enrichment. For more information, see Example: Add Event Enrichment Fields with Tooling API in the Change Data Capture Developer Guide.