function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ryan Thomas 317Ryan Thomas 317 

Event Participants copy to OCR (Shared Activity)

We have Shared Activity turned on and can add multiple participants to Events/Meetings.  When a contact is added to an Event, is there a way to automatically copy their information to the Opportunity Contact Roles object?  We can default the Role to "contact" (if they aren't already present in OCR).  Any ideas?
Glyn Anderson (Slalom)Glyn Anderson (Slalom)
Ryan, When a Contact is added to an Event, Salesforce creates an EventRelation record.  Unfortunately, EventRelation does not support triggers, workflow, or data validation rules.  So you can't create an OCR in real time.  You could, perhaps, create a batch job that runs periodically to sync up EventRelation records with OpportunityContactRole records.
Ryan Thomas 317Ryan Thomas 317
Can you help with a batch job to do this?