Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 55831

as is GenerateAuthenticationHeader CRM 2015

$
0
0

I have next code in crm 2013 and need replace for crm 215

var authenticationHeader = GenerateAuthenticationHeader();
// Prepare the SOAP message.
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'>"+
authenticationHeader+
"<soap:Body>"+
"<Update xmlns='schemas.microsoft.com/.../WebServices'>"+
"<entity xsi:type='new_inmueble'>"+
"<new_estadodelinmueble>"+estado+"</new_estadodelinmueble>"+
"<new_fechalimitedeseparacion>"+fecha+"</new_fechalimitedeseparacion>"+
"<new_inmuebleid>"+inmuebleId+"</new_inmuebleid>"+
"</entity>"+
"</Update>"+
"</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","schemas.microsoft.com/.../Update");
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);
}
// Display a confirmation message and open the updated contact.
else
{
// alert("Contact with id = "+inmuebleId+" successfully updated.");
// window.open("/sfa/conts/edit.aspx?id={"+inmuebleId+"}");
}


Viewing all articles
Browse latest Browse all 55831

Trending Articles