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