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)

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

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