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

Javascript function - replace ampersand with hex encoding

$
0
0

Hi guys,

I have a piece of Javascript that creates a unique URL to open a report based on the Account name, however it's failing when the name includes an Ampersand.  I have realised that I need to replace the ampersand in the name with the hex code %26 in order for it to work, but I'm not 100% on how to update my function.  For reference, the current function is below:

function OpenUrl() {
var nameAttr = parent.Xrm.Page.data.entity.attributes.get("name");
if (nameAttr !== null) {
var name = nameAttr.getValue();
var url = "myserver/.../ReportViewer.aspx;Client=" + name + "&rs%3aCommand=Render";
window.open(url);
}

Any help appreciated!


Viewing all articles
Browse latest Browse all 79901

Trending Articles



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