How to read XML file in Dynamics CRM 2011 using Javascript
Views (1286)
In Dynamics CRM 2011, we could maintain the XML files using web resource utility, which is a very good feature. It could be read using Javascript which is also maintained in the web resources of Dyanmics CRM 2011.You could make use of this feature when you want to populate some values dynamically.
Sample xml file –Settings.xml
<Configurations> <Configuration id=”License”>54383-32343-213-22-2-21232-1222</Configuration> <Configuration id=”Name”>Client 1</Configuration> </Configurations>
Javascript sample code to read XML File:
var xmlPath = "../WebResources/Settings.xml";
var xmlnodePath = "//Configurations/Configuration";
var xmldoc = new ActiveXObject("Microsoft.XMLDOM");
xmldoc.preserveWhiteSpace = true;
xmldoc.async = false;
xmldoc.load(xmlPath);
var params = new Array();
var xmlnodelist;
xmlnodelist= xmldoc.selectNodes(xmlnodePath);
for (var i = 0; i < xmlnodelist.length; i++)
{
params[i] = xmlnodelist(i).attributes[0].value;
}
Archiviato in:Microsoft Dynamics Crm Tagged: CRM, Microsoft Dynamics CRM, Xml
This was originally posted here.

Like
Report
*This post is locked for comments