Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Any alternatives to Xrm.Internal.openDialog method in Dynamics 365?

Posted on by 55

Usually Xrm.Internal.openDialog method is used to open dialog for earlier version of CRM. But it seems, for newer release Dynamics 365, it is not working properly.

I tried to open HTML page( written in Bootstrap framework) using this method in chrome. Page was not behaving as expected.

Any alternative method or way to open dialog similar to OOB lookup dialog?

Any help will be really appreciated!!

Note: Xrm.Internal.openDialog method is unsupported

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Any alternatives to Xrm.Internal.openDialog method in Dynamics 365?

    if you're in the webresource then parent refers to the window where you opened the webresource, which is the parent of the one with all the javascript and the Xrm object (because you called parent.msCrm.crmdialog() to open it ).

    So you need to get the subpage called contentIframe0 or 1 or 2 ect of the parent to try and find one frame with the javascripts in it.

    you can do that with a loop,

    for (var i = 0; i < 10; i++) {

         contentframe = parent.document.getElementByName('contentIFrame' + i)[0]

         //insert code to check if its the correct contentIframe here

    }

    but...

    We found it easier to just register the Xrm to the parent in the onload, or before opening the webresource.

    so:

    parent.Xrm2 = Xrm;

    parent.Mscrm.CrmDialog(url, this, 200, 400);

    now, when you're in the dialog, parent will refer to the window where you registerd that Xrm2.

    so now parent.Xrm2 should contain something you can use.

  • Alex Po Profile Picture
    Alex Po on at
    RE: Any alternatives to Xrm.Internal.openDialog method in Dynamics 365?

    MaKeer,
    If you open web resource in separate window try

    parent.opener.Xrm.Page
  • MaKeer Profile Picture
    MaKeer on at
    RE: Any alternatives to Xrm.Internal.openDialog method in Dynamics 365?

    Hi,

    If I use parent.Mscrm.CrmDialog (with Turbo forms), I am not able to read CRM field values using Xrm.Page.getAttribute or parent.Xrm.Page.getAttribute. Is there any way to read CRM attribute values from pop-up window opened using parent.Mscrm.CrmDialog?

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Any alternatives to Xrm.Internal.openDialog method in Dynamics 365?

    also unsupported but Mscrm.CrmDialog might work. (but this isn't modal, so will require a rewrite of all code dealing with what to do after the dialog closes and return values ect)

    and if you have turboforms enabled you need to use parent.Mscrm.CrmDialog.

    i don't use internal.openDialog myself, but trying parent.Xrm.Internal.openDialog might be worth a shot for the same reasons it works for mscrm.crmdialog.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans