Events are being created in salesforce from some external application. I need to get the participants from them in a trigger.
I am looping over the newly inserted Events and then trying to query, but the below query doesnt return anything. Although if I try the query in workbench with a proper ID for an Event, I am getting the required EventRelation record.
List<EventRelation> myEventRelations = [SELECT ID, EventID, RelationID, Relation.Email FROM EventRelation WHERE eventId=: myEvent.Id];
Where myEvent is an iterator over Event records.