Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To invoke an IIFE declared in the parent window from an IFrame within Dynamics CRM, you can use the parent object to access the function. For example:

In the parent window:

(function() {
    var myFunction = function() {
         alert("Hello from parent window!");
    };
    myFunction();
})();

In the IFrame:

parent.myFunction();

This will trigger the alert message defined in the parent window. Note that you should only access the parent window if the IFrame and parent window are within the same domain, to prevent security issues.