0

I am creating an event using trigger and I'm also creating an invitee using the EventRelation object. When I go to that particular event, the invitee is shown on the list but when I go to that invitee's Home tab, I am not getting any notification there.

But when I create an event manually and add invitees, then the notification is present on the invitee's Home tab. Any particular reason?

This is my trigger to create the event and add the invitees

trigger Calendar on Account (after insert) {
    for(account acc : trigger.new){
        if(acc.name != NULL){
              Event e = new Event();
              e.StartDateTime = system.today();
              e.EndDateTime = system.today();
              e.Subject = 'Testing1';
              insert e;

              EventRelation er = new EventRelation(EventId = e.id,
              RelationId = '00528000001JFlo', isInvitee = True);
              insert er;
        }
    }
0

I figured it out. Very silly actually. Had given the start and the end date as the same hence by the time I could log in to the Invitee's org, the meeting was over. All I had to do was change the end date and it showed up

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.