[SalesForce] EventRelation and Event Object Salesforce

I have a requirement to add multiple Assignees to an Event. To do so after creating an Event record, I am also creating EventRelation record right after. Here's the steps in the flow:

Step 1: Create an Event with Event.OwnerId = (A User record). Return the Event.Id to a variable. Lets say the variable name vCreatedEvent.

Step 2: Create a EventRelation with EventRelation.EventId = vCreatedEvent, EventRelation.RelationId = < Event Additional Assignee 1 > (A User record).

Step 3: Create a EventRelation with EventRelation.EventId = vCreatedEvent, EventRelation.RelationId = < Event Additional Assignee 2 > (A User record).

Step 4: Create a EventRelation with EventRelation.EventId = vCreatedEvent, EventRelation.RelationId = < Event Additional Assignee 3 > (A User record).

After running about four steps in the flow, I see five records created in EventRelation where first two are related to Account and Contact respectively and remaining three are related to three Users which are in step2, 3 and 4. However, in addition to these separate Event records getting created for the above mentioned three additional assignees. Which seems odd to me and how do I avoid creation of Event records and only keep the EventRelation records.

Best Answer

These other events you're seeing are so that each invited user can see the event on their calendar and modify some details about the event. You can't stop these from occurring, as it is a built-in feature of the Shared Activities feature.

Related Topic