CRM 2011 - 使用 javascript 保存时进行重复检测
CRM 2011 - Duplicate Detection while saving using javascript
我有一个 javascript,它使用 OData 并在 PhoneCall 实体中创建记录。
我有这个 PhoneCall 实体的 Subject 属性,它需要是唯一的。
我在以下 link 中阅读了有关 "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,它使用 OData 并在 PhoneCall 实体中创建记录。 我有这个 PhoneCall 实体的 Subject 属性,它需要是唯一的。 我在以下 link 中阅读了有关 "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.