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
pbulaczpbulacz 

StartDateTime and EndDateTime on Event Skewed in Trigger

I have a before insert / before update trigger on event that does some calculations and uses the StartDateTime and EndDateTime fields for it's processing.

 

Now all works fine for single events (i.e. 1 off events not part of a series).

 

However when I try and UPDATE an event that is part of a series the startdatetime and enddatetime appear wrong, and are ruining my results.

 

This only happens on UPDATE, for insert of a recurring series everything calculates fine, but when I just try and edit only one of the events in a series the startDateTime get skewed.

 

Any Ideas? Is it somehow based on system time vs the local time settings of the org or something like that?

 

My startdatetime SHOULD BE

START =2009-06-15 08:30:00  END =2009-06-16 17:30:00
But as you can see in the Debug log excerpt below the start and end times are completely skewed!!

20090611063904.439:Trigger.Event_Before_Update: line 55, column 9: INITIAL START =2009-06-15 22:30:00
20090611063904.439:Trigger.Event_Before_Update: line 56, column 9: INITIAL END =2009-06-16 07:30:00

 Debugging a single event that isn't part of a series doesn't shed much light either as the start and end time/date is STILL SKEWED however for some reason the code processes it fine???

 

This ones a bit confusing any help would be great.

 

 

Message Edited by pbulacz on 06-10-2009 11:58 PM
Message Edited by pbulacz on 06-11-2009 04:12 PM
Message Edited by pbulacz on 06-11-2009 04:13 PM
Best Answer chosen by Admin (Salesforce Developers) 
pbulaczpbulacz

Alright so I figured that it converts it the time to GMT hence the discrepancy in the debug log however still no clue why it doesn't calc correctly... Anyway I'll keep at it.

 

Patrick