+ Start a Discussion

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('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);





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