We have working code that is based on 25.0 API and used EventAttendee object in its SOQL. We are now trying to Migrate the code to latest 41.0 API but the EventAttendee object does not exists in the latest API.

It has been replaced by EventRelation Object that has few different set of fields. Below is the SOQL that is working API 25.0

List<EventAttendee> presentattendeelist=[select e.event.RecordTypeId,e.Attendee.Email,Attendeeid,e.Event.id,e.Event.Status__c,e.Event.ownerid,e.event.startdatetime from EventAttendee e where Event.id in:eventid  and Event.Subject=:'Daily Call'];

I am not sure how to port this SOQL into 41.0 compatible version using the Event Relation object.


v25.0 was Summer '12, so the changes you seek would have been covered in the release notes for v26.0 - Winter '13.

Winter '13 Release notes.

The particular section you want from those release notes is:

Event and EventAttendee Object Changes

Important changes have been made to the Event and EventAttendee API objects. Now any customer or partner can modify event attendees with the API. These changes might impact existing Apex and API packages.

  • The EventAttendee object is no longer supported.
  • There is a new EventRelation object with fields to manipulate Whos, Whats, and invitees on events. You can modify invitees on an event. Note: A Who is a related contact or lead, and a What is a related record.
  • Update operations on child events are very limited.

These changes allow you to create and modify event attendees (invitees) through the API. Previously, this was possible through the UI only. The new API also supports Shared Activities for events so users can relate non-recurring events to as many as 10 contacts. Even if you don’t enable Shared Activities for events for your users, the following event object changes will affect you.

There is also a useful table in that document you should check.

Generally speaking, the Event is still accessible on the EventRelation via the EventId field.

The main change for you is that the AttendeeId has become RelationId and could be to a User, Contact, or Lead record.

  • Thanks, this was helpful. I wonder why these release notes don't turn up when searched on google. – Neel Nov 22 '17 at 7:27

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.