Hello Team,
when i am tring to call workflow by its id.I have get error.I think Xrm.Page.context.getAuthenticationHeader()
function is no longer exist in crm 2015 online.Please suggest me or correct the code.
Thanks
Code:
function startWorkflow() {
var xml = "" +
"<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<soap:Envelope xmlns:soap=\"schemas.xmlsoap.org/.../envelope\" xmlns:xsi=\"www.w3.org/.../XMLSchema-instance\" xmlns:xsd=\"www.w3.org/.../XMLSchema\">" +
Xrm.Page.context.getAuthenticationHeader() +
"<soap:Body>" +
"<Execute xmlns=\"schemas.microsoft.com/.../WebServices\">" +
"<Request xsi:type=\"ExecuteWorkflowRequest\">" +
"<EntityId>" + Xrm.Page.data.entity.getId() + "</EntityId>" +
"<WorkflowId>" + '227DB37B-938F-4FE9-829A-D982B371002A' + "</WorkflowId>" +
"</Request>" +
"</Execute>" +
"</soap:Body>" +
"</soap:Envelope>";
var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
xmlHttpRequest.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
xmlHttpRequest.setRequestHeader("SOAPAction", "schemas.microsoft.com/.../Execute");
xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
xmlHttpRequest.send(xml);
}
*This post is locked for comments