web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Replacement for Xrm.Dialog

(0) ShareShare
ReportReport
Posted on by 45

Hi Community,

Xrm.Dialog in the Javascripts  doesn't seems to be working in UCI. Can someone help me out with any replacements for this.

Thank You!

I have the same question (0)
  • Suggested answer
    Henry J. Profile Picture
    5,237 on at
    RE: Replacement for Xrm.Dialog

    Hello,

    Can you share more details about your use of Xrm.Dialog?
    I don't thing this has ever been a documented and supported Client API.

    Or are you talking about Process Dialogs? They indeed no longer work in Unified Interface, as announced here:
    https://docs.microsoft.com/en-us/power-platform/important-changes-coming#process-dialogs-are-deprecated

    Henry

  • GiridharRaju Profile Picture
    45 on at
    RE: Replacement for Xrm.Dialog

    Hi Henry,

    var DialogOption = new Xrm.DialogOptions;

    This is where I find the error

    Thank!

  • Suggested answer
    Henry J. Profile Picture
    5,237 on at
    RE: Replacement for Xrm.Dialog

    Are you also using namespaces such as Xrm.Internal.openDialog in your code?
    Because using Xrm.Internal clearly shows that this is not supported and this is probably why it doesn't work in Unified Interface.

    Can you please share more details on your code and what exactly you're trying to achieve with this script?

    Thanks
    Henry

  • GiridharRaju Profile Picture
    45 on at
    RE: Replacement for Xrm.Dialog

    Hi Henry,

    Below is the Snippet code in the javascript.

    var DialogOption = new Xrm.DialogOptions;

       DialogOption.width = width; DialogOption.height = height;

       // DialogOption.width = 1200; DialogOption.height = 620;

       Xrm.Internal.openDialog(src,

                                DialogOption,

                                null, null,

                                CallbackFunction);

    Do we have any replacement for this.

    Thank You,

    S. Giridhar Raju

  • Verified answer
    Henry J. Profile Picture
    5,237 on at
    RE: Replacement for Xrm.Dialog

    Hello,

    What is that script doing exactly?

    If you need to display a message to a user with OK & Cancel buttons, then you should consider using this method:
    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-navigation/openconfirmdialog

    Henry

  • Verified answer
    Niktia Polyakov Microsoft Profile Picture
    on at
    RE: Replacement for Xrm.Dialog

    Please look at this if this fits your needs:

    docs.microsoft.com/.../navigateto

    Specifically this works well with web resources that need to be visualized in "Modal Dialog" way:

    navigationOptions

    target: Number. Specify 1 to open the page inline; >>>>> 2 to open the page in a dialog. <<<<<

    Entity lists can only be opened inline; >>>>>> web resources can be opened either inline or in a dialog. <<<<<<

  • Suggested answer
    rthompson Profile Picture
    1,532 on at
    RE: Replacement for Xrm.Dialog

    Hi,

    This looks like what you are looking for.

    var displayMessage = "Are you sure you want to do something here?";
    var confirmStrings = { text: displayMessage, title: "What are you doing" };
    var confirmOptions = { height: 80, width: 260 };
    Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then(
       function (success) {
          if (!success.confirmed) {
            //Set the field back to false
            formContext.getAttribute("new_issetupcompleted").setValue(false);
            return;
          }
    
          //Do something
       }
    );
    

  • Suggested answer
    GiridharRaju Profile Picture
    45 on at
    RE: Replacement for Xrm.Dialog

    Hello Nikita polyakov,

    I'm using Xrm.Navigation.navigateTo(pageInput, navigationOptions) to navigate to the html. Here I'm passing a string value through data in pageinput object. My doubt is how can I get that value in html code.

    Thank You!

  • Niktia Polyakov Microsoft Profile Picture
    on at
    RE: Replacement for Xrm.Dialog

    Can you share an example?

    docs.microsoft.com/.../navigateto

    Here is a code sample from the docs page, in that first collection you would have to add 'data' object which sounds like what you are doing and you are not able to retrieve this value in the web resource?:

    var pageInput = {

       pageType: "webresource",

       webresourceName: "new_sample_webresource"

    };

    var navigationOptions = {

       target: 2,

       width: 400,

       height: 300,

       position: 1

    };

    Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(

       function success() {

               // Handle dialog closed

       },

       function error() {

               // Handle errors

       }

    );

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 365 | Integration, Dataverse, and general topics

#1
#ManoVerse Profile Picture

#ManoVerse 101

#2
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 66 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans