【发布时间】:2012-01-20 13:51:29
【问题描述】:
使用 CRM 2011 oData 服务创建联系人时出现此错误。
var newContact = Object();
newContact.firstname = Xrm.Page.getAttribute("ct_leadconversioncontactfirstname").getValue();
newContact.lastname = Xrm.Page.getAttribute("ct_leadconversioncontactlastname").getValue();
newContact.gendercode = Xrm.Page.getAttribute("ct_leadconversioncontactgender").getValue();
newContact.jobtitle = Xrm.Page.getAttribute("ct_leadconversioncontactjobtitle").getValue();
newContact.websiteurl = Xrm.Page.getAttribute("ct_leadconversioncontactwebsite").getValue();
var jsonContact = window.JSON.stringify(newContact);
$.ajax({
async: false,
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: jsonContact,
url: methodUrl,
beforeSend: function (XMLHttpRequest) {
//ensures the results will be returned as JSON.
XMLHttpRequest.setRequestHeader("Accept", "application/json");
},
success: successCallback,
error: failedCallback
});
【问题讨论】:
标签: c# wcf jquery dynamics-crm dynamics-crm-2011