PlatformEventChannel
Salesforce の [変更データキャプチャ] ページで変更データキャプチャ通知に選択されたエンティティのコレクションを表します。変更データキャプチャでは、選択されたエンティティの作成、更新、削除、復元されたレコードの通知のみが送信されます。Metadata メタデータ型を拡張し、その fullName 項目を継承します。
ファイルのサフィックスおよびディレクトリの場所
PlatformEventChannel コンポーネントのサフィックスは .platformEventChannel で、platformEventChannels フォルダに保存されます。
バージョン
PlatformEventChannel コンポーネントは、API バージョン 45.0 以降で使用できます。
特別なアクセスルール
この型をリリースおよび取得するには、「アプリケーションのカスタマイズ」権限が必要です。
項目
| 項目名 | 項目の型 | 説明 |
|---|---|---|
| channelMembers | PlatformEventChannelSelectedEntity[] | 標準オブジェクトとカスタムオブジェクトを含む、変更データキャプチャ通知に選択されたエンティティのイベント名のリスト。 |
| channelType | PlatformEventChannelType (string 型の列挙) | 必須。チャネル種別。有効な値は、次のとおりです。
|
| label | string | 必須。チャネルの表示ラベル。サポートされる値は ChangeEvents のみです。 |
PlatformEventChannelSelectedEntity
| 項目名 | 項目の型 | 説明 |
|---|---|---|
| selectedEntity | string | 必須。変更データキャプチャ通知に選択されたエンティティのイベント名。たとえば、Account 標準オブジェクトの場合、名前は AccountChangeEvent、MyObject__c カスタムオブジェクトの場合、名前は MyObject__ChangeEvent です。 |
使用方法
PlatformEventChannel メタデータ型では createMetadata() および deleteMetadata() コールはサポートされていません。また、destructiveChange.xml をリリースして変更データキャプチャの選択すべてを削除することもできません。変更データキャプチャの選択を更新するには、更新した PlatformEventChannel 定義をリリースするか、updateMetadata() コールを使用します。
宣言的なメタデータの定義のサンプル
次の PlatformEventChannel コンポーネントの例には、3 つの選択されたエンティティ (Account、Contact、Employee__c カスタムオブジェクト) のイベント名が含まれます。
1<?xml version="1.0" encoding="UTF-8"?>
2<PlatformEventChannel xmlns="http://soap.sforce.com/2006/04/metadata">
3 <channelMembers>
4 <selectedEntity>AccountChangeEvent</selectedEntity>
5 </channelMembers>
6 <channelMembers>
7 <selectedEntity>ContactChangeEvent</selectedEntity>
8 </channelMembers>
9 <channelMembers>
10 <selectedEntity>Employee__ChangeEvent</selectedEntity>
11 </channelMembers>
12 <channelType>data</channelType>
13 <label>ChangeEvents</label>
14</PlatformEventChannel>前の定義を参照する package.xml の例を次に示します。
1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3 <types>
4 <members>ChangeEvents</members>
5 <name>PlatformEventChannel</name>
6 </types>
7 <version>45.0</version>
8</Package>