Pregunta

I would appreciate if someone can help me with the following requirement for building a SOQL.

Object1: Event : Fields to get: Id, Subject, OwnerId

Object2: EventAttendee : Fields to get: EventId, AttendeeId

Object3: User : Fields to get: Id, Email

Note: Id of Event = EventId of EventAttendee & AttendeeId of EventAttendee = Id of user

So the requirement is to lookup Id from Event into EventId of EventAttendee and get the respective AttendeeID, then for the same AttendeeId lookup into user to get the Email address.

Thanks for your help.

¿Fue útil?

Solución

One way would be to start from Event, go down to Attendees, then up to Users. The table that holds attendees is actually called EventRelation. Something like that should get you started:

SELECT Id, Subject, OwnerId,
    (SELECT EventId, RelationId, Relation.Email FROM EventRelations)
FROM Event
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top