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

add event invitation without sending email?

I'm creating events in an apex routine, and also need to create some "group events" (with multiple users invited.)

So my code creates an event, gets the id, then adds child EventAttendee records.  It works- so far so good. 
The problem is that it seems to always cause emails to get sent to the users invited.  When adding invitees via the UI, there's two options - SAVE, and SAVE AND SEND UPDATE.  The latter seems to send an email while the former doesn't.

With Apex/API I don't see how to make the same thing happen.  Is there a field in either object I can set to avoid sending the email?

Thanks much!

Susana NTSSusana NTS

Hi Sparky,


Unfortunately I don't have the answer to your question.

Maybe you found it but you haven't update this post :)


Anyway, maybe you could help me here... I was wondering if it would be possible to create in apex code a new event on a public calendar with invitees. 


Thanks in advance.






Hi Susana,

From everything I can find (and I tried it myself) there's no way add invitees to Events programmatically. I want to do exactly what you describe but this seems like a show-stopper.

I say this because the Idea below is still outstanding...


"Unlock EventAttendee in the SalesForce API"
A standard Contact (or Account, Lead, etc) is joined with an Event using the EventAttendee object. Using this relationship you can associate a contact with an event in the Salesforce interface standard application interface. However, if you try to associate a contact with an event using the API, you will find that the EventAttendee object is read-only. Please fix this! With this capability an entire new class of applications could be written using the Salesforce API!! Without this ability developers have to "recreate the wheel" for time/event based apps by creating our own contact and event objects. Also, if you create a custom object, for some reason you cannot join that custom object to the event side of your relationship - only to the contact side. So, the only option is to roll all your own objects. I would much rather use the standard objects in Salesforce. I have even studied the Event Management Custom App written by and they also have to create custom objects that basically duplicate the functionality already found in the Contact and Event object. Why make us do this? Why do this yourselves :-)

no indication that it is in progress or released. Latest post on Aug. 2010


And this issue is discussed numerous times here in the developer board at:


I'd love to know how Sparky did "So my code creates an event, gets the id, then adds child EventAttendee records.  It works- so far so good."


Sorry, this was so long ago that I really don't remember the context or the result.


I do know that for a long time I was doing some work with public calendars, so it may have been in that context.