Thursday, May 10, 2018

Use the View data in the Chart- html Javascript for further processing

 function getParametersFromQuery(query) {

            var parametersDictionary = new Array();

            var parameters = query.split('&');

            for (var i = 0; i < parameters.length; i++) {

                var keyAndValue = parameters[i].split('=');

                parametersDictionary[unescape(keyAndValue[0])] = unescape(keyAndValue[1]);

            }

            return parametersDictionary;

        }
 function loadChartFromCrm(callback) {
           
            var parameters = getParametersFromQuery(window.location.search.substring(1));
            entityName = parameters["typename"];
            parameters = getParametersFromQuery(parameters["data"]);

            var id = parameters["visid"].substr(1, 36);
            var viewId = parameters["viewid"].substr(1, 36);
            var type = parameters["vistype"];
        }
The above retrieved View Id  can be used to retrieve the FetchXml of the view- field Name- "FetchXml" to retrieve the View fetchXml, which in turn can be directly used as the fetch query to retrieve the data corresponding to the View, which can be used for further processing in scenarios like placing Push pins on Bing Map for All the Accounts in NYC / Highlighting the locations where Contacts exist etc.

No comments:

Post a Comment