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

Error while retrieving data from XML file

$
0
0

Hi all

I am using below code

function ShowConfiguration() {
debugger;
var serverUrl = window.parent.Xrm.Page.context.getClientUrl();
var webResourceName = "apikey"
var webResourceURL = serverUrl + "/WebResources" + "/" + webResourceName
var nodePath = "//Configuration";
var XmlDoc= new ActiveXObject("Microsoft.XMLDOM");
XmlDoc.preserveWhiteSpace = true;
XmlDoc.async = false;
XmlDoc.load(webResourceURL);
var nodelist;
nodelist = XmlDoc.selectNodes(nodePath);
document.getElementById('APIkey').value = nodelist[0].selectSingleNode("APIkey").nodeTypedValue;
}

With the following xml file

<?xml version="1.0" encoding="utf-8"?>
<Configuration>
<APIkey>ab15c4d132d2aff98b952ca886a92e5a-us14</APIkey>
</Configuration>

This code giving me this 



 

Please tell me. Where am I wrong?

 

Thank You


Viewing all articles
Browse latest Browse all 46379

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>