var requestmain = fetchxml;
$.ajax(
{
type: "POST",
contentType: "application/json; charset=utf-8",
datatype: "json",
url: serverurl + "/XRMServices/2011/Organization.svc/web",
async: false,
data: requestMain,
headers: { "Accept": "application/xml, text/xml, */*", "Content-Type": "text/xml; charset=utf-8", "SOAPAction": "http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/RetrieveMultiple" }
})
.done(function (XMLHttpRequest) {
var strResponse = GetXmlValue(XMLHttpRequest.childNodes[0]);
xmlDoc = $.parseXML(strResponse);
})
.fail(function (XMLHttpRequest) {
alert("Error retrieving accounts using fetch xml");
})
.always(function (XMLHttpRequest) {
});
function GetXmlValue(value) {
if (value.xml == undefined) {
return (new XMLSerializer()).serializeToString(value);
}
return value.xml;
}
$.ajax(
{
type: "POST",
contentType: "application/json; charset=utf-8",
datatype: "json",
url: serverurl + "/XRMServices/2011/Organization.svc/web",
async: false,
data: requestMain,
headers: { "Accept": "application/xml, text/xml, */*", "Content-Type": "text/xml; charset=utf-8", "SOAPAction": "http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/RetrieveMultiple" }
})
.done(function (XMLHttpRequest) {
var strResponse = GetXmlValue(XMLHttpRequest.childNodes[0]);
xmlDoc = $.parseXML(strResponse);
})
.fail(function (XMLHttpRequest) {
alert("Error retrieving accounts using fetch xml");
})
.always(function (XMLHttpRequest) {
});
function GetXmlValue(value) {
if (value.xml == undefined) {
return (new XMLSerializer()).serializeToString(value);
}
return value.xml;
}
No comments:
Post a Comment