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
hikiran rajuhikiran raju 

trigger on Event

Hi everyone,
How can we fire a trigger to create a new Event when a record is create in my custom object.
Can anyone help me over here..
 Thanks in advance

RAM AnisettiRAM Anisetti
Hey raju,

try this one..

Here replace Custom_Object__c with ur custom object 
trigger createEvent on Custom_Object__c(after insert){

List<Event>listevents=new List<Event>();

    Event e=new Event();
	//please fill values of StartDateTime,EndDateTime,Subject either static or dynamic
  e.StartDateTime = oc.Start__c;
  e.EndDateTime = oc.End__c;
  e.Subject = oc.Subject__c;
  e.WhatId =;

  insert listevents;


Chandra Sekhar CH N VChandra Sekhar CH N V
This can even be done with a process builder. Did you give a try?