You need to sign in to do that
Don't have an account?
jawtech
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);
}
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