2
使用CRM 2011 oData服务创建联系人时出现此错误。错误:为microsoft.crm.sdk.data.services类型指定的属性名'firstname'无效
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
});
感谢您的建议,它绝对张贴到正确的地方。我用小提琴来验证它发送的地点和内容。 – user1231231412 2011-12-14 21:40:27
实际上,它看起来像oData使用删除空格的属性的“显示名称”。这是正确的吗?我只是打电话给ContactSet,看着字段,它显示“名字”。该属性具有名字“firstname”和显示名称“First Name”。 – user1231231412 2011-12-14 21:49:28