Hi Krishna ,
Please Make Sure Use all my code I have change code now it will the return the result
result value be like
0: (2) ["URL", "/asdasd/asdas/dasdasdas"]
1: (2) ["CategoryId", "12313123131"]
You can use it like result[0][1] to get Url and result[1][1] for Category
below is updated code
function getValue(values){
if(values!= "")
//alert(decodeURIComponent(values));
var value = decodeURIComponent(values);
var vals = new Array();
var resultSet = new Array();
vals =value.split("&");
for (var i in vals) {
vals[i] = vals[i].replace(/\+/g, " ").split("=");
resultSet.push(vals[i]);
}
return resultSet;
}
function getUrlVars(execContext){
var vals = new Array();
var result = new Array();
if (location.search != "") {
vals = location.search.substr(1).split("&");
for (var i in vals) {
vals[i] = vals[i].replace(/\+/g, " ").split("=");
}
//look for the parameter named 'data'
var found = false;
for (var i in vals) {
if (vals[i][0].toLowerCase() == "data") {
result = getValue(vals[i][1]);
found = true;
break;
}
}
if (!found)
{ alert('no Parameter'); }
}
else {
alert('no Parameter');;
}
return result;
}
getUrlVars();
For Calling javascript
var windowsOption = { height: 500, width: 830, openInNewWindow: true };
var customParameters = "URL=" + orgURL +"&CategoryId=" +pCategoryId;
Xrm.Navigation.openWebResource("fcpm_DisplayActivities_html", windowsOption, customParameters);