Skip to main content
Martin Teplanszki ha preguntado en #Apex
Hi,

Is it possible anyhow to subscribe to the standard ChangeEvents channel or any custom change event channel from an apex trigger?

I would like to get notified about changes (insert, update, delete) in the database for more entities and wish to do async operation based on the event message in apex code. Therefore I wouldn't introduce external system for this purpose, would like to solve it internally. EventChannel would be a perfect option if I could subsrcibe to them in apex code.

Simple CustomObject_ChangeEvent is not satisfactory in this case because for the logic the needed information is that the change was made by someone sometime in the org. The object where the change was made is not an information I need for the future.

I appreciate if you have any ideas or knowledge to share.

Thank you in advance!
1 respuesta
  1. 8 ene 2021, 8:46
    As far as I know, you can use EMP connector to subscribe to the channel. See Subscribe to a Custom Platform Event Channel to learn more

    A trigger can subscribe to a change event. We can query the EventBusSubscriber standard object using SOQL to understand which apex triggers subscribed to change events

    As far as I know, you can use EMP connector to subscribe to the channel. See Subscribe to a Custom Platform Event Channel to learn moreA trigger can subscribe to a change event.
0/9000