想象一下将电话或约会标记为已完成的情况。
我已经在这两种情况的后期操作中设置了一个插件,我尝试删除另一个不相关的记录(使用组织服务删除方法)。我尝试删除的记录已启用审核。删除失败,我收到业务流程错误。如果关闭审核,则该过程成功。有没有人知道问题可能是什么?
答案 0 :(得分:0)
这是不可能的。只需在“标记为完成”按钮中添加一个功能,即可删除所需的任何记录。
或者创建一个自定义按钮,背后有这个逻辑。
希望这有帮助。
以下是通过JavaScript删除记录的代码
// Identify the contact to delete.
var contactid = "89a7e456-8098-bb33-b345-0003gg9ff218";
var authenticationHeader = GenerateAuthenticationHeader();
// Prepare the SOAP message.
var xml = "<?xml version='1.0' encoding='utf-8'?>"+
"<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'"+
" xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"+
" xmlns:xsd='http://www.w3.org/2001/XMLSchema'>"+
authenticationHeader+"<soap:Body>"+"<Deletexmlns='http://schemas.microsoft.com/crm/2007/WebServices'>"+
"<entityName>contact</entityName>"+
"<id>"+contactid+"</id>"+
"</Delete>"+"</soap:Body>"+"</soap:Envelope>";
// Prepare the xmlHttpObject and send the request,
var xHReq = new ActiveXObject("Msxml2.XMLHTTP");
xHReq.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
xHReq.setRequestHeader("SOAPAction","http://schemas.microsoft.com/crm/2007/WebServices/Delete");
xHReq.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xHReq.setRequestHeader("Content-Length", xml.length);
xHReq.send(xml);
// Capture the result,
var resultXml = xHReq.responseXML;
// Check for errors,
var errorCount = resultXml.selectNodes('//error').length;
if (errorCount != 0)
{
var msg = resultXml.selectSingleNode('//description').nodeTypedValue;
alert(msg);
}