Given this code:
var ToDateDate = new String(Request.Form("Comm_ToDateTime"));
ToDateDate = ToDateDate.split("/");
var newToDateTime = ToDateDate[2]+"-"+ToDateDate[1]+"-"+ToDateDate[0]+" "+Request.Form("Comm_ToDateTime_TIME")+":00.000";
CurrentCommunication("Comm_ToDateTime") = newToDateTime;
CurrentCommunication.SaveChanges();
How can i save the date?
This way the date (as Days, month and year) got saved but the hours, minutos does not.
The final output for the newToDateTime
variable is 2016-19-09 08:50:00.000
if i use this value (2016-19-09 08:50:00.000
) in a barehand SQL update, it works
Turns out that i have to build the Date object with the values and then use getVarDate()
mehtod to to pass from a Date Javascriopt object to a record’s date field value
which at the end it is the same i was doing :S
Found my answer in this Sage CRM Community