Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Getting error when accessing a advanced find filter in iframe on UCI

(0) ShareShare
ReportReport
Posted on by 55

Hi Guys, 

I have an advanced filter in iframe on a form. the below code works fine when accessing the iframe in normal crm environment.

function OnIFrameReadyState() {
     debugger;
    window.frameLoaded = true;
    var fetchXML = Xrm.Page.getAttribute("field_fetchxml");
    if (fetchXML != null && fetchXML.getValue() != null) {
        debugger;
        //var advFind = document.getElementById('IFRAME_FilterCriteria').contentWindow.aFind;
        
        Xrm.Page.ui.controls.get('IFRAME_FilterCriteria').getObject().contentWindow

         if(Xrm.Page.ui.controls.get('IFRAME_FilterCriteria').getObject().contentWindow){

             document.getElementById('IFRAME_FilterCriteria').contentWindow.advFind.parentElement.children.advFind.control.set_fetchXml(fetchXML.getValue());
         }

        //if (aFind != null) {
           // debugger;
            //aFind.parentElement.children.aFind.control.set_fetchXml(fetchXML.getValue());
        //}
    }
}  

 but when I access it in UCI I am getting this error

content-window-error.png

what could be the solution to this problem.

Thanks.

*This post is locked for comments

  • Verified answer
    dynamo arsalan Profile Picture
    dynamo arsalan 55 on at
    RE: Getting error when accessing a advanced find filter in iframe on UCI

    Hi David,

    My bad, I didn't use the getObject() to set the fetchxml in the control. By adding it to line below fixed it. getObject() is working in this scenario.

                   Xrm.Page.ui.controls.get('IFRAME_FilterCriteria').getObject().contentWindow.aFind.parentElement.children.aFind.control.set_fetchXml(fetchXML.getValue());
    


    Thanks.

  • David Jennaway Profile Picture
    David Jennaway 14,063 on at
    RE: Getting error when accessing a advanced find filter in iframe on UCI

    From the error is looks like the getObject() method is returning null. It may be that this is not yet fully supported in UCI

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans