You need to sign in to do that
Don't have an account?

How to invoke 'Save & Send Update' on Multi-purpose Calendar Event edit in Code
I have a need to be able to recreate the 'Save & Send Update' button functionality on the event screen in APex Code, can anyone help with a code snippet on how to do this please.
Basically I want to have an automated process that monthly creates an 'Event' and then sends out a Meeting invite to all the Invitees. I particularly want the email functionality that has the 'Respond to This Request' button in the email.
Does anyone know what code is run when the 'Save & Send Update' button is pressed?
Thanks in advance.
Basically I want to have an automated process that monthly creates an 'Event' and then sends out a Meeting invite to all the Invitees. I particularly want the email functionality that has the 'Respond to This Request' button in the email.
Does anyone know what code is run when the 'Save & Send Update' button is pressed?
Thanks in advance.
All Answers
In you apex code after inserting the event create your event attendees and try setting the Database.DmlOptions triggerUserEmail to true. This may cause the email to be sent to each attendee. Example:
Database.DMLOptions dlo = new Database.DmlOptions();
dlo.EmailHeader.triggerUserEmail = true;
//Insert the attendees using database.insert(attendees list, dmlOption);
database.insert(attendees, dlo);
Hope this helps!
Hi Izay,
That has pointed me in the right direction and has gone a long way towards giving me a solution, I have managed to get an invite sent to all Attendees
- since v25 these are now called 'EventRelation', had to use triggerOtherEmail as they were not users.
However, I still can't get it to send an invite to the Event owner, you cannot add an EventRelation for the Owner as SF quietly deletes it.
As expected pressing the 'Save and Send Update' on the event screen does invite the owner, so there must be another (as yet unknown) database option to cause this to happen.
Any ideas on what that might be?
Many thanks for your help so far!
Mike
I am sorry, I dont have the solution for your question. But I have the same requirement to send an email to invitees when they get added via Apex code using EventRelation. I tried with many combination of Dml options but couldn't. Can you please post the code snippet which worked for you?
Many Thanks in advance!
Hemant
List<EventRelation> ers = new List<EventRelation>();
ers.add(new EventRelation(eventID='00Ud000000LdBNREA3' ,relationID='003d000001XL0tF'));
Database.DMLOptions dlo = new Database.DMLOptions();
dlo.EmailHeader.triggerUserEmail = false;
dlo.EmailHeader.triggerOtherEmail = true;
dlo.EmailHeader.triggerAutoResponseEmail = false;
Database.insert(ers,dlo);
I am facing some exception while inserting the list of EventRealtion rercords,like Con't to bulk insert/upsert on Eventrelation object. In this case how are you inserting bulk EventRelation for a Event? Can you please help?
It would be great if u can share ur working code to my mail balu1211@gmail.com.
Thanks,
Hussain.