0

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.

1

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.

  • That's what I thought but looking through the EventRelation documentation it nowhere specifies this as a functionality. May be I am looking at the wrong place? – Json Bourne Shell Sep 19 '18 at 0:34
  • @JsonBourneShell nice moniker, by the way. There's several documents that use the phrasing "child events", which suggests that this is the behavior you're seeing, but I don't see a place in the documentation that explicitly calls it out, even in the EventRelation object, which is where I'd expect to see such information. – sfdcfox Sep 19 '18 at 0:46
  • when we hear a phrase "child event" there should kind of a relationship between a child and a parent. In this case, there no relationship between the Events being created and the EventRelation which I am creating. Because, I have a separate component display Events all duplicated Events are also showing up there. Thanks for the moniker compliment and the responses btw. :) – Json Bourne Shell Sep 19 '18 at 1:38
  • Salesforce got back to me and they have the same response as yours, only thing to add here is we cannot modify child events except ReminderDateTime and IsReminderSet fields and child events are clones of parent event at insert and at subsequent updates. – Json Bourne Shell Oct 4 '18 at 22:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.