我有一个 JavaScript,它使用 OData 并在 PhoneCall 实体中创建一条记录。 我有这个 PhoneCall 实体的主题属性,它需要是唯一的。 我在以下链接中阅读了有关“SuppressDuplicateDetection”参数的信息 - https://msdn.microsoft.com/en-us/library/hh210213.aspx
如何在 OData 调用中利用此参数?
这是我的 JavaScript 代码 -
var serverUrl = Xrm.Page.context.getServerUrl() + '/XRMServices/2011/OrganiationData.svc/PhoneCallSet'
$.ajax
({
type:"POST",
contentType: "application/json; charset=utf-8",
datatype: "json",
url: serverUrl,
data: phoneCallData,
beforeSend: function(xhr)
{
xhr.setRequestHeader("Accept", "application/json");
},
success: function (data, textSTatus, XmlHttpRequest)
{
//my success LOC
},
error: function (xmlHttpRequest, textSTatus, errorThrown)
{
//error handler
},
async: false
});
最佳答案
很遗憾地说:无法在客户端使用 odata 的 SuppressDuplicateDetection
选项。
we need the CreateRequest to enable Dup detection while creating record and therefore this feature is not available when creating records using oData.
关于javascript - CRM 2011 - 使用 JavaScript 保存时进行重复检测,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45608162/