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
Jay-DawgJay-Dawg 

Unable to add event attendees via the API (I'm using AJAX Toolkit v11)?

I have an s-control which invokes the API using Javascript and the AJAX Toolkit v11. My code is able to create Events, and I'm stuck now trying to create such Events to include multiple attendees.
 
The following code snippet does NOT work:
 
var TestAttendee = new sforce.SObject("EventAttendee")
TestAttendee.AttendeeId = "00570000000mZcp" //this is a valid User ID
TestAttendee.EventId = "00U70000006J7oq" //this is a valid existing Event ID
var result = sforce.connection.create([TestAttendee])
This returns the error "CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY". What am I missing?
 
Is EventAttendee createable? The API documentation does not list "create" as one of the available methods for this object type, however some of the EventAttendee fields say that they do support "create".
 
What about the Event.IsGroupEvent field? Do I need to set that to TRUE first, or does that happen automatically when attendees are added to that event? It doesn't seem like that field is updateable anyway, so I couldn't set it to TRUE if I wanted to.
 
Do the attendees need to be added during the initial creation of the event? How is that accomplished? I would assume you need the event first, in order to pass the EventID to the EventAttendee object, but perhaps I'm wrong?
 
Please help.
 
P.S. Salesforce Premier Support says that it IS possible to add EventAttendees via the API, but they won't tell me how and instead told me to buy Professional Services...
SuperfellSuperfell
EventAtendee is not writable via the API.
sparkysparky
Am I crazy, or was this changed recently?

I had some apex code that created an EventAttendee object as part of a trigger.  I swear the tests ran a month or so ago.  I come back to it today and it tells me it's not writeable.
jeremyfrey1jeremyfrey1
I can't quite make heads or tails over this change in 12.0:

New or Changed SOAP Headers

  • EmailHeader: A group event is an Event for which IsGroupEvent is true. The EventAttendee object tracks the users, leads, or contacts that are invited to a group event. Note the following behaviors for group event emails sent through the API:
    • Sending a group event invitation to a User respects the triggerUserEmail option
    • Sending a group event invitation to a Lead or Contact respects the triggerOtherEmail option
    • Emails sent when updating or deleting a group event also respect triggerUserEmail and triggerOtherEmail, as appropriate

If sounds like it's somehow possible to send out "group event emails" through the API, but I'm buggered if I can figure out how this relates to creating group events.
Ron HessRon Hess
it's always been not writable from the API
sparkysparky
Thanks, Ron.
I must be imagining things.


mcherrymcherry
If you can't directly create EventAttendee objects, can you indirectly add an attendee to an event using the API by automatically sending and invitation for an event?
sfdcfoxsfdcfox
You can't add members to an event through the API, as Ron said. You can't send an invite to a contact or lead and have them appear on the event's attendee list. It simply is not possible in this release, or any prior release, of the API to add event attendees. The correct method would be an AJAX request, which means someone would need to figure out the exact data that tells Salesforce that attendees are being modified and then emulate that through JavaScript. I don't have the tools for this, but maybe someone could figure this out and post it? I'll see what I can do, but I'm only one person.
VarunCVarunC
Any suggestions on How to Add Attendees to an Event using APEX ?

I have a requirement where I need to create Full Event Form as Custom VF page, so if Adding Attendees is not possible then I think I'm Very BADLY stuck .. :( :( .. plz help ...

any suggestions ... ?
bmfbmf
Last time I checked, it still was not possible to do so. If you are really desperate, you could attempt to use screen scraping to find out how to add event attendees, but such a method is unreliable and likely to break when salesforce.com developers decide to change their internal API (i.e. for improvements to the system).

I would not recommend using that approach, and instead simply vote for the feature on the IdeaExchange (you're not alone in wanting this feature...).
VarunCVarunC