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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to call the IFRAME OnReadyStateComplete event for a html WebResource

(0) ShareShare
ReportReport
Posted on by 500 Most Valuable Professional

I have a custom entity with a WebResource on.  In the Form Events reference (https://msdn.microsoft.com/en-us/library/gg334481.aspx#BKMK_IFRAMEOnReadyStateCompleteEvent) it lists an IFRAME OnReadyStateComplete event, but I'm unable to determine how to wire this up.  I've seen this image:

but I don't have an Events tab in my properties window to choose an event for:

screenshot.2.jpg

I'm running CRM Online 2015 Update 1

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    MilindP Profile Picture
    1,019 on at

    On the html web resource, add the code

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Page</title>
        <script src="ClientGlobalContext.js.aspx" type="text/javascript"></script>
        <script type="text/javascript">
    
            document.onreadystatechange = function () {
                if (document.readyState == "complete") {
                    
                    window.parent.Xrm.Page.getAttribute(<fieldname>).setValue("Ready");
    
                }
            }
            
        </script>
        <meta charset="utf-8">
    </head>
    <body>
    .
    .
    .
    .</body>


    And on change event of the field <fieldname> of main form where the web resource added, execute your code.

  • Daryl LaBar Profile Picture
    500 Most Valuable Professional on at

    Milind P - That is a valid work around, and I thank you for it, but it is not an answer...  

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans