3

The EventRelation object has an IsDeleted field, which implies that I should be able to query for deleted records. However, I'm not seeing that. After manually removing an invited contact from an Event, I cannot find the deleted record.

This is the POC code I'm using in a scratch org with just a handful of events & EventRelations, so that I can query all records without a where clause (to eliminate one possible point of failure). I have the System Administrator profile in the scratch org, and I own all of the involved records.

List<EventRelation> res = [
    SELECT id, EventId, RelationId, IsDeleted, LastModifiedDate
      FROM EventRelation
       ALL ROWS
];
system.debug(res.size());
system.debug(JSON.serialize(res));

I never get any records with IsDeleted=true, and the size of my query result decreases each time I remove an invitee.

I'm not looking to undelete, just trying to identify people removed from meetings. As EventRelation doesn't support triggers, I cannot run code upon deletion. How to I query these deleted records?

Update: I also tried running the query from Workbench with the "include deleted & archived records" option, just to see if a different API would get different results, but I'm still not able to see an EventRelation I deleted only seconds before.

2
  • Were you able to solve the issue? This is exactly what I am facing so it is still an issue in fall of 2023.
    – Ward Wood
    Commented Nov 13, 2023 at 15:28
  • @WardWood Not that I recall, but that was 5 years and 1 job ago. I don't recall what we ended up doing, but I don't think I ever found a way to track this information. If you have the ability to open a developer support case (Premier support, Partner Portal), it might be worth asking Salesforce for input. Commented Nov 13, 2023 at 15:38

0

You must log in to answer this question.

Browse other questions tagged .