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
jawtechjawtech 

copy date field into datetime field

I'm auto-creating a task reminder from the activity date.

 

I would like to take the value of the activitydate field and put it into the reminderdatetime field (datetime). What do I need to do to the date so I don't get the error "Illegal assignment from Date to Datetime". Convert it? Cast it? Format it?

for(Task ti : t){ //for each task

ti.put('ReminderDateTime',ti.ActivityDate);

ti.put('isReminderSet', true);

}

 

Message Edited by jawtech on 04-02-2009 08:17 PM
OnDem DevOnDem Dev

Please try this,

 

for(Task ti : t){    //for each task

   ti.put('ReminderDateTime', DateTime.valueOf(t.ActivityDate+' 00:00:00'));

   ti.put('isReminderSet', true);

}

 

Thanks,

OnDem

Message Edited by OnDem Dev on 04-03-2009 11:06 AM