How to Create/Update an EventRelation records for contacts or a Lead record

  • 1
  • Problem
  • Updated 3 years ago
  • (Edited)
I want to create/update an EventRelation  record related to an Event record,

In salesforce I could create an Event with multiple contacts or only one Lead (limitation);

If I want to update/change WhoId Lead Contact and save I mark rows for deletion and save, and this it will not work and I get Error : EventRelation can't be created for a Event that already has a lead
OR if I change Contacts to Lead
Error:  EventRelation of a lead can’t be created for a Event 
that has already had EventRelation of contacts or accounts, opportunities, custom objects, and other entities.

How can I handle this situation? Please help.
Photo of Hasantha Liyanage

Hasantha Liyanage

  • 1,446 Points 1k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
I don't think you'll be able to get around the salesforce "1 lead" limitation on Event Relation. What SOQL returns is what it returns... 
Photo of Hasantha Liyanage

Hasantha Liyanage

  • 1,446 Points 1k badge 2x thumb
Do you mean that I won't be able to save the updated Event? (eg: remove existing Lead and add contacts)