0

I created a ticket with Salesforce because outlook attendee event deletion is not firing the trigger or flow. So basically, when these events are deleted from Salesforce there is no way to run any automation.

They suggested Change Data Capture as a workaround. So, I have to catch the event delete action via the Change Data Capture trigger. I checked this documentation and looks like we can only do that after insert.

trigger EventChangeEventTrigger on EventChangeEvent (after insert) {

}

Is it possible to catch the event delete action via the Change Data Capture trigger?

1 Answer 1

2

The trigger itself is always defined as after insert, as it is the event that is being created (thus, after insert). The headers for the event will tell you if it is an insert, update, delete, undelete, etc.

for(EventChangeEvent event: Trigger.new) {
  EventBus.ChangeEventHeader header = event.ChangeEventHeader;
  String changeType = header.changeType;
  switch on changeType {
    when 'DELETE','GAP_DELETE' {
      // Do something here
    }
  }
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .