Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Obtain Apex Trigger Subscribers
Example
This example SOQL query selects several fields from EventBusSubscriber. For more information about EventBusSubscriber fields, see EventBusSubscriber in the Object Reference for Salesforce and Lightning Platform.
1SELECT ExternalId, Name, Topic, Position, Status, Tip, Type FROM EventBusSubscriberThe returned result shows that there are two Apex triggers subscribed to change events. One trigger is subscribed to AccountChangeEvent and one to ContactChangeEvent.
| ExternalId | Name | Topic | Position | Status | Tip | Type |
|---|---|---|---|---|---|---|
| 01q2J000000g0kb | MyAccountChangeTrigger | AccountChangeEvent | 226751 | Running | -1 | ApexTrigger |
| 01q2J000000g0kg | MyContactChangeTrigger | ContactChangeEvent | 226752 | Running | -1 | ApexTrigger |
You can filter the query results by using a WHERE clause. For example, this query filters by the topic ContactChangeEvent.
1SELECT ExternalId, Name, Topic, Position, Status, Tip, Type FROM EventBusSubscriber
2WHERE Topic='ContactChangeEvent'The query returns only the trigger subscribers to ContactChangeEvent, in this case, one trigger.
| ExternalId | Name | Topic | Position | Status | Tip | Type |
|---|---|---|---|---|---|---|
| 01q2J000000g0kg | MyContactChangeTrigger | ContactChangeEvent | 226752 | Running | -1 | ApexTrigger |