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)

Setting iFrame height programmatically

(0) ShareShare
ReportReport
Posted on by 55

In Dynamics CRM, how do you set the height of an iframe programmatically? The following function doesn't do anything, the iframe always comes up the same size. Even when you go to iframe properties and change the row numbers there, it still doesn't cause any changes in size.

function doOnLoad(sender, args) {

        setIframeHeight();

}

function setIframeHeight() {

    //lowest control in iframe

    var element = $('btnInsert');

    //the following line gets called, and what's displayed is 25

    alert(window.parent.parent.frames[0].document.getElementById('IFRAME_TransactionProduct_RA_d').parentNode.height);

    //the following line doesn't do anything        

    window.parent.parent.frames[0].document.getElementById('IFRAME_TransactionProduct_RA_d').parentNode.height = 500;

}

*This post is locked for comments

I have the same question (0)
  • LindsayH Profile Picture
    252 on at

    Did you ever get a solution to this? I am having the same issue.

  • Verified answer
    DH kumar CRM Profile Picture
    1,345 on at

    Hi

    pls check this url where you can iframe hieght.

    inogic.com/.../automatically-resize-the-iframe-to-adjust-to-the-form-size

    Hope this might have helped you!

  • Community Member Profile Picture
    on at
  • Community Member Profile Picture
    on at

    In Dynamics CRM, you can't use document.getElementById('something')

    The getElementById return allways a null object so you can't change the height or value, …

  • Community Member Profile Picture
    on at

    <Duplicate post removed - unable to delete :( >

  • Community Member Profile Picture
    on at

    @Harold Jabraud

    document.getElementById("IFRAME_MyIframe");

    used to work ok in CRM2011.  Now, for CRM365/CRM2016, you need to modify that to:

    parent.document.getElementById("IFRAME_MyIframe");

    Hope that helps  ;^)

  • Community Member Profile Picture
    on at

    This did the trick - thank-you! I spent far too long on this! :D

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