我有以下内容来更新记录:
var currentTimeBeingTracked = getCurrentTimeTracked();
if (currentTimeBeingTracked != null) {
currentTimeBeingTracked.dagency_EndDateTime = new Date();
var jsonTrackedTime = window.JSON.stringify(currentTimeBeingTracked);
$.ajax({ type: "POST",
contentType: "application/json; charset=utf-8",
datatype: "json",
url: ODataPath + "/dagency_trackedtimeSet",
data: jsonTrackedTime,
beforeSend: function (XMLHttpRequest) {
XMLHttpRequest.setRequestHeader("Accept", "application/json");
},
success: function (data, textStatus, XmlHttpRequest) {
var newTimeTracked = data.d;
RetrieveTrackedTimes();
alert("Stopped tracking your time successfully.");
window.top.document.getElementById("contentIFrame").contentWindow.location.reload();
},
error: function (XmlHttpRequest, textStatus, errorThrown) {
debugger;
alert("Couldn't stop tracking your time. " + XmlHttpRequest.responseText);
}
});
}
但我不断收到这条消息:
处理请求流时出错。将属性“CreatedOn”的请求负载中的值转换为类型“DateTime”时遇到错误,这是属性的预期类型。有关更多详细信息,请参阅内部异常。
为了创建记录,我使用了以下完美运行的代码:
var trackedTime = new Object();
var timeEntryName = prompt("Please enter a name for the tracked time:", "New time entry");
if (!timeEntryName) {
return false;
}
var isBillable = confirm("Is this task billable? If Yes, press OK.");
trackedTime.dagency_name = timeEntryName;
trackedTime.dagency_StartDateTime = new Date();
trackedTime.dagency_Billable = isBillable;
var slot = new Object();
slot.Id = crmForm.ObjectId;
trackedTime.dagency_Slot = slot;
var jsonTrackedTime = window.JSON.stringify(trackedTime);
$.ajax({ type: "POST",
contentType: "application/json; charset=utf-8",
datatype: "json",
url: ODataPath + "/dagency_trackedtimeSet",
data: jsonTrackedTime,
beforeSend: function (XMLHttpRequest) {
XMLHttpRequest.setRequestHeader("Accept", "application/json");
},
success: function (data, textStatus, XmlHttpRequest) {
var newTimeTracked = data.d;
RetrieveTrackedTimes();
alert("Started tracking your time successfully.");
window.top.document.getElementById("contentIFrame").contentWindow.location.reload();
},
error: function (XmlHttpRequest, textStatus, errorThrown) {
alert("Couldn't start tracking your time. " + XmlHttpRequest.responseText);
}
});
问题是什么?我在哪里可以找到消息所指的内部异常?