web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Display Header Record Image onto the Form

(0) ShareShare
ReportReport
Posted on by 11,323

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?

8203.Screenshot_5F00_2.png

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mahadeo Matre Profile Picture
    17,021 on at

    Hi,

    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.

  • Thomas David Dayman Profile Picture
    11,323 on at

    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>


  • AmeyHolden Profile Picture
    230 on at

    Thomas David Dayman

    Thanks for posting the code Thomas it was super helpful! How did you stop it coming out so fuzzy?

     instapost.png

  • Thomas David Dayman Profile Picture
    11,323 on at

    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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans