Quantcast
Viewing all articles
Browse latest Browse all 79901

Attach a dynamic URL to image web resource

Hello,

We have a custom field to which we are attaching an icon through DOM and when that icon is clicked it open a new window, which pulls data from another custom entity (script below).

After our upgrade to CRM 2015 Online Update 1, this is broken because accessing DOM (document.getElementById) is not supported by the new form renderer.

I created an image web resource and displayed it next to the field on the form but is it possible for me to attach the URL through any XRM methods OR for that matter any other way out?

Thank you.

Existing Code:

=========

span.onclick = function () {

//Set popup window features

var features = "location=no,menubar=no,status=no,toolbar=no";

//Ensure that etn is set to logical name of custom entity

var url = Xrm.Page.context.getClientUrl() + "/main.aspx?etn=x_phonenum&id=%7b" + phRecordId + "%7d&newWindow=true&pagetype=entityrecord";

window.open(url, "_blank", features, false);
};

span.appendChild(imgCtl);

//add icon with the field
document.getElementById(fieldName).appendChild(span);


Viewing all articles
Browse latest Browse all 79901

Trending Articles



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