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!