Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Iframes in dynamics online

Posted on by

I'm trying to implement the use of an iframe to display a webpage from an outside website (more specifically, a form on that website) on a custom entity's form. I am having no luck with iframes, and the documentation out there is not helping. I've tried both an iframe and an html web resource with an iframe tag in a div. The only success I've had is getting a youtube video to show up. Otherwise, I am getting a blank iframe. When I inspect the frame source, I am getting a blank page (other than the youtube embed I tried). I've tried inserting a variety of urls, all to no avail. Is there any particular magic on working with iframes in dynamics? Am I missing something obvious? Thanks for any help.

*This post is locked for comments

  • Suggested answer
    Mahadeo Matre Profile Picture
    Mahadeo Matre 17,021 on at
    RE: Iframes in dynamics online

    you can query string to pass data

  • fishyjj Profile Picture
    fishyjj on at
    RE: Iframes in dynamics online

    Thanks. Now what if the webpage or form that's opening is not a crm form, but a form from another site? Is there any reliable way to pass data between the crm and this form?

  • Suggested answer
    Mahadeo Matre Profile Picture
    Mahadeo Matre 17,021 on at
    RE: Iframes in dynamics online

    To open CRM entity form you can Xrm.Utility.openEntityForm.  In this function you can pass parameters also.

    Here are more detailed information about openEntityform

    mahadeomatre.blogspot.com/.../xrmutility-functions-openentityform.html

    msdn.microsoft.com/.../jj602956.aspx

    and for web pages you can use query string to pass data.

  • fishyjj Profile Picture
    fishyjj on at
    RE: Iframes in dynamics online

    Is there a way to use window.open to then pass data between the two webpages? The two pages being the CRM form and the webpage I want to open?

  • Suggested answer
    Mahadeo Matre Profile Picture
    Mahadeo Matre 17,021 on at
    RE: Iframes in dynamics online

    x-frame-option is security option and I don't think so you will able to bypass this option for websites you don't run.

    For the content / pages/ websites you want to show on CRM entity form, instead of displaying them in Iframe, you can create HTML web resource with button, add this web resource in CRM entity form and open page/website in different window from web resource button using window.open

  • fishyjj Profile Picture
    fishyjj on at
    RE: Iframes in dynamics online

    Thanks for your reply. The ms website you referenced did work in my iframe. Is there a way to set that x-frame-option on a website that I do not myself run?

  • Suggested answer
    Mahadeo Matre Profile Picture
    Mahadeo Matre 17,021 on at
    RE: Iframes in dynamics online

    When websites has X-Frame-Options set , then depending on option those websites are shown iframe.

    developer.mozilla.org/.../X-Frame-Options

    if you try microsoft website url like

    www.microsoft.com/.../ebooks-and-videos.aspx

    it will work in Iframe

  • Suggested answer
    Nick.Doelman Profile Picture
    Nick.Doelman 1,947 Most Valuable Professional on at
    RE: Iframes in dynamics online

    Might be an issue with the source site not allowing itself to be displayed in an Iframe, for example www.google.com will not allow itself to be embedded in an Iframe.

    Years ago (CRM 4.0, I think) I needed to set the URL via Javascript because just setting it on the control wouldn't work:

    Xrm.Page.getControl(<<iFramename>>).setSrc("www.somewebsite.com");

    Just some ideas...

    Cheers

    Nick

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans