Notifications
Announcements
No record found.
Hi,
I want to display whats ever in the header photo onto the form. I have the Web resource added to the form but i'm not sure what the code would look like. Any help?
*This post is locked for comments
You can show entity image into web resource.
using this URL you can get entity image
var imageUrl = Xrm.Page.context.getClientUrl()+"/image/download.aspx?attribute=entityimage&entity="+ Your entity schema Name+"&id="+entity record Id+"&Timestamp="+ new Date().getTime();
you can show this image using Iframe in web resource.
Note: Image resolution and dimensions may be different.
If anyone wants the complete code:
<html> <head> <style> </style> <script src="../WebResources/psd_/jquery_1.9.1.min.js"></script> <script> function load() { var imageUrl = window.parent.Xrm.Page.context.getClientUrl()+ "/image/download.aspx?attribute=entityimage&entity=" + window.parent.Xrm.Page.data.entity.getEntityName() + "&id="+window.parent.Xrm.Page.data.entity.getId() + "&Timestamp="+ new Date().getTime(); document.getElementById("customerAssetImage").src = imageUrl; } </script> <meta><meta><meta><meta></head> <body onload="load()" style="word-wrap: break-word;"> <img src="nothing.jpg" id="customerAssetImage" name="customerAssetImage"/> </body> </html>
Thomas David Dayman
Thanks for posting the code Thomas it was super helpful! How did you stop it coming out so fuzzy?
Hi Amey,
This post is very old so i'm not sure why your image is fuzzy.
Could be the actual resolution of the image itself or it could be fixed with some html/css magic maybe.
I'm glad my code helped :)
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2