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)

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

(0) ShareShare
ReportReport
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

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    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.

  • MaKeer Profile Picture
    on at

    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?

  • Alex Po Profile Picture
    on at

    MaKeer,
    If you open web resource in separate window try

    parent.opener.Xrm.Page
  • Community Member Profile Picture
    on at

    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.

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