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
dotnet developedotnet develope 

how to create a event on calendar through custom code.

Hi All,

 

  I want to create a event on calendar through custom code.

 

I found that for creating a event on calendar, it takes default value as 'Non-group Event'' for groupeventtype  when invitees are given.

 

 ** if the invitees are not assinged then groupeventtype value be 0 (ie 'non-even event').

 

But my code should work, i am not adding any invitees to the event.

 

 Event newevent = new Event();
newevent.ownerid = '00590000000mytG';
newevent.startdatetime = datetime.valueOf('2011-10-21 09:00:00Z');
newevent.enddatetime = datetime.valueOf('2011-10-21 10:00:00Z');
newevent.subject = 'My Call';
newevent.whoid = null;
newevent.location = 'Pune';
insert newevent; 

  

 

Thanks in Advance.