我想在Contact实体(以及其他一些实体)中更新_parentcustomerid_value
但是我遇到了这样的问题 - 提供的属性是System.Object类型,当预期的类型为System.Guid时,我使用此link来更新实体属性。谁能建议我做什么?也许我做错了什么或者不可能更新ids
。
对于lookup属性,您必须使用single valued navigation property而不是lookup property。
entity["[email protected]"] = "/contacts(DFE54660-37CD-E511-80DE-6C3BE5A831DC)"
完整代码如下所示:
// define the data to update a record
var data =
{
"[email protected]": "/contacts(DFE54660-37CD-E511-80DE-6C3BE5A831DC)"
}
// update the record
Xrm.WebApi.updateRecord("contact", "61a0e5b9-88df-e311-b8e5-6c3be5a8b200", data).then(
function success(result) {
console.log("Contact updated");
// perform operations on record update
},
function (error) {
console.log(error.message);
// handle error conditions
}
);