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
ChizChiz 

Create an Event with pre fielded invitees

Is there a way to create an Event with some number of invitees from Apex?

Simple

Event e = new Event(any params here);
insert e;

 doesn't help. It can create an event but there is no possibility to add invitees programmaticaly.

 

It can be done from UI only. All we can do is to pre-fielled ids of users we want to invite to this event. But currently logged in user must push Save & Send Update button to create an event and send invitation e-mails to invitees.

 

What we think as workaround is to perform the same http POST request as SF perform after user clicks this button.

I tried to achieve this using HttpRequest class as well as PageReference. But no luck.

 

Maybe anyone had better luck than me?

steve456steve456

I have done it with an Apex  trigger.

 

 

 

ChizChiz

How it can be possible to add invitees to an event from Apex? Even trigger. Trigger on what object and which event?

steve456steve456

Yes Trigger on an other custom object which maps information with the Event object  to add invitees to a particular event on the calendar

 

 

 

ChizChiz

But how to add invitees to an event if SF doesn't give us such possibility (using Apex)?