First some background, the function is registered on onChange of the alldayevent checkbox and checks for whether said checkbox returns true. Anyway, when trying to set recurrence this does not work. It is something to do with the way that datetimes now work, I think. I could use any sort of guidance with this as I have nearly had it with this. The client requirement is the reason for the modification of start and end times to 9 - 5.
function SetAllDayEventTimes() { //if (xrmPage.ui.getFormType() == 1 && Xrm.Page.getAttribute("isalldayevent").getValue() == true ) if (xrmPage.getAttribute("isalldayevent").getValue() == true) { var duration = xrmPage.getAttribute('scheduleddurationminutes'); duration.setValue(0); duration.setValue(60 * 8); var start = xrmPage.getAttribute('scheduledstart'); var end = xrmPage.getAttribute('scheduledend'); var newStart = new Date(start.getValue()); var startHour = newStart.getHours(); newStart.setHours(9, 0, 0); start.setValue(newStart); var newEnd = new Date(start.getValue()); var endHour = newEnd.getHours(); newEnd.setHours(endHour 8); end.setValue(newEnd); xrmPage.getAttribute("scheduledstart").setValue(newStart); xrmPage.getAttribute("scheduledend").setValue(newEnd); } }