0

I am looking for a way to capture the Account associated with a Contact at the time the Contact is added to an Event. Currently, the Account gets updated in the EventRelation object when the Contact's Account changes. This is a problem because we want to know the Account the Contact was associated with when added to the Event.

An idea I am thinking of pursuing is the creation of a custom object that will function similar to EventRelation but give me control of keeping the AccountID static once a Contact is added to the Event. I would like to be able to handle this with a Flow, but I don't see a way to trigger the flow based on changes to the EventRelation table. Is there a way to do that via a Flow or is a custom trigger needed?

Other thoughts?

1 Answer 1

0

I resolved this issue by

  • creating a custom object with two fields - EventWhoRelation ID and Account ID
  • created a flow that is triggered when an event is created or updated and the WhoCount is greater than 0
  • I collect records from the EventWhoRelation table that match with the event id
  • For each record in the collection, I search my new object to see if there is a record with a matching EventWhoRelation ID
  • If there isn't a match, I create a record in my new object that contains the EventWhoRelation ID and the Account ID

By taking these steps, I permanently capture the contact's account when the contact was added to the Event Name section. I don't handle the situation if a contact is removed from an event or if an event is deleted. In my use case, this doesn't matter since I am simply using my new object to have a record of what the contact's account was when the contact was added to the event.

You must log in to answer this question.

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