0

I have never worked with Microsoft dynamics CRM.

I'm looking for a way to generate a new panel with a map and then put every contact in the map.

I don't know anything about Microsoft dynamics CRM, but I know perfectly how to use Google Maps API V3.

I tried all day, but I can't get something.

I only need to know where or how I can retrieve contacts info to put in the map.

I'm so confused about it, because it's my first time with dynamics CRM.

Thanks to everyone.

It's my code where I'm so confused.

<html>
<head>
  <title>Nada</title>
      <meta http-equiv="X-UA-Compatible" content="IE=8" />
    <script src="../ClientGlobalContext.js.aspx"></script>
    <script src="Scripts/jquery1.4.1.min.js" type="text/javascript"></script> 
    <script src="Scripts/RESTJQueryMap.js" type="text/javascript"></script>
  <script type="text/javascript">
  function SoapCall() {
  var xml = 
    "" +
    "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
    " <soap:Envelope xmln:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"" + 
      " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" +
      " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
      GenerateAuthenticationHeader() +
      " <soap:Body>" +
        " <RetrieveMultiple xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\">" +
          " <query xmlns:q1=\"http://schemas.microsoft.com/crm/2006/Query\" xsi:type=\"q1:QueryExpression\">" +
            " <q1:EntityName>account</q1:EntityName>" +
            " <q1:ColumnSet xsi:type=\"q1:ColumnSet\">" +
              " <q1:Attributes>" +
                " <q1:Attribute>name</q1:Attribute>" +
              " </q1:Attributes>" +
            " </q1:ColumnSet>" +
          " </query>" +
        " </RetrieveMultiple>" +
      " </soap:Body>" +
    "</soap:Envelope>" +
    "";

  var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
  xmlHttpRequest.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
  xmlHttpRequest.setRequestHeader("SOAPAction", " http://schemas.microsoft.com/crm/2007/WebServices/RetrieveMultiple");
  xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
  xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
  xmlHttpRequest.send(xml);

  var resultXML = xmlHttpRequest.responseXml;
  alert(resultXML.xml);

  // Check for errors.
  var errorCount = resultXML.selectNodes('//error').length;
  if (errorCount != 0) {
    var msg = resultXML.selectSingleNode('//description').nodeTypedValue;
    return "-1";
  }

  var results = resultXML.selectNodes('//BusinessEntity');

  for (var i = 0; i < results.length; i++) {
    var output = results[i].selectSingleNode("./q1:name").nodeTypeValue;
    alert(output);
  }
}

  </script>
</head>
<body>
<button onClick="SoapCall()">Empezar</button>
</body>
</html>

Where the button starts "SoapCall()"

Then I have errors:

GET .../ClientGlobalContext.js.aspx 404 (Not Found)

GET .../WebResources/Scripts/jquery1.4.1.min.js 500 (Internal Server Error) new_PRU:7

GET .../WebResources/Scripts/RESTJQueryMap.js 500 (Internal Server Error)

Jota
  • 17,281
  • 7
  • 63
  • 93

1 Answers1

0
  1. To show your contacts in Map you need to read an XML file.
  2. That XML File should be generated from the data(Contacts) in Micsoft Dynamics CRM.
  3. Through plugin Read contacts and prepare an XML (with required format)
  4. Through same plugin insert/update the xml type webresource (that contacts xml)
  5. Read the xml in Map (HTML Webresource) and show the points in the map

Regards, Pavan.G

Pavan Kumar
  • 190
  • 2
  • 8