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 365 | Integration, Dataverse...
Answered

How to display an html webresource in modal form in Unified inerface on-premise v9

(0) ShareShare
ReportReport
Posted on by 10

Hi,

I've searched around trying to find out how I can open an html webresource in a modal form in the unified interface for an on-premise deployment.

I have found Xrm.Navigation.navigateTo but it appears to be only for online implementations.

Does anybody know how this can be achieved for an on-premise deployment?

  • Verified answer
    Snice Profile Picture
    50 on at

    Hi

    I was in exactly in the same situation last week! I used the Dialog Box for that. You can refer to following post

    debajmecrm.com/.../

    I had to fix some sizing problems but globally it's fine.

    Snice

  • Phil - BNPPRE Profile Picture
    10 on at

    Hi Snice,

    Thanks for your quick reply, I did see that post but was a bit confused as to what code belonged in the PopupDialog.js script.

    When you implement this do you get the 'Next' button appearing?

    Thanks

  • Snice Profile Picture
    50 on at

    There is no Next button. It will show only the content of your webresource as the idea behind that is basically a form with an IFrame that will display your webresource.

  • Phil - BNPPRE Profile Picture
    10 on at

    I'll give it a go and see how I get on - thanks for you help.

  • Snice Profile Picture
    50 on at

    in case you need to close the popup from your webresource here is the trick:

    $("button[data-id='dialogCloseIconButton']", parent.document).click();

  • Phil - BNPPRE Profile Picture
    10 on at

    The HandlerUniqueID guid's are they all arbitary or have they got to be retrieved from your CRM organization?  

    It seems the blog article has two different ones for PopupDialog.js

  • Snice Profile Picture
    50 on at

    Yes you can leave them like that or generate new one, it doesn't matter. Most important is they should be unique.

  • Phil - BNPPRE Profile Picture
    10 on at

    I have managed to change the dialog hright, but not the Iframe height - How do you do that?

  • Snice Profile Picture
    50 on at

    If you want to have the same size for all the webresources you show, then it's easy you can adjust the rowspan attribute

    7380.pastedimage1619077913737v1.png

    In our case, every webresources has a different size... So the size have to be dynamic according to the IFrame content.

    I didn't find any supported way to do that.

    Here is what I ended to do:

    function onload(e) {
    //...
        fc.ui.controls.get("IFRAME_ModalDialog").setSrc(Xrm.Utility.getGlobalContext().getClientUrl()   "/webresources/"   webresource   "?data="   data);
        
        $("#IFRAME_ModalDialog").ready(function () {
            setTimeout(function(){ resize();}, 300);        
        });
    }
    
    function resize(){
        var webresourceHeight = window.top.$("div[data-id='PopupDialog']").find("div[role='presentation']").first().height();
        window.top.$("#id-473a54c3-4989-4408-9b78-181a0b90d162-1-IFRAME_ModalDialog-webResourceLabelControlWrapper").height(webresourceHeight-35);
    }

    The guid that is in the id part correspond to the FormId

    I spent lot of time on that and didn't find any better solution..

  • Phil - BNPPRE Profile Picture
    10 on at

    Hi Snice,

    I have it working thanks to your help, you really got me out of a whole with this one. And thanks for sharing your solution to the sizing problem, I was thinking I would have to create a new dialog box for each webresource I needed to display, I will try implementing your method this morning.

    Again thanks so much for your help.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 77 Super User 2026 Season 2

#2
ParthPatel249 Profile Picture

ParthPatel249 56

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 44 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans