+ Start a Discussion
dotnet developedotnet develope 

Trigger on event object is not invoked when event startdate is change through calendar

Hi All,

 

I wrote a trigger on event object (before insert/update events).

its working fine when i create or edit the record , but it fails when i update the event startdate through calendar (ie changing the time of the event ). 

The trigger is not invoked.

 

Could you please suggest me.

 

Thanks in advance.

 

 

 

Nilesh ManeNilesh Mane

Please share the trigger code.... So that i can help you quickly...

dotnet developedotnet develope

 

Hi Nilesh,

 

Thanks for responding...

 

please find the code below.

 

trigger evnt on event(before insert,before update)

{

   for(event evnt : trigger.new)

{

   evnt.meetingstartdate__c = evnt.startdate;

   evnt.meetingenddate__c = evnt.enddate;

}

}

 

 

 

Nilesh ManeNilesh Mane

trigger evnt on event(before insert,before update)

{

   for(event evnt : trigger.new)

{

   evnt.meetingstartdate__c = evnt.StartDateTime;

   evnt.meetingenddate__c = evnt.EndDateTime;

}

}

 

I tried above code, Its working fine. Try with this one.

 

Happy Coding :)

Nilesh ManeNilesh Mane

If you are still getting any problem

 change data type of  evnt.meetingstartdate__c  & evnt.meetingenddate__c from 'Date' to 'DateTime'.

because evnt.StartDateTime & evnt.EndDateTime are of data type 'DateTime'