Skip to main content

Notifications

Announcements

No record found.

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!

  • 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

       }

    );

  • Suggested answer
    GiridharRaju Profile Picture
    GiridharRaju 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!

  • Suggested answer
    rthompson Profile Picture
    rthompson 1,530 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
       }
    );
    

  • Verified answer
    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. <<<<<<

  • Verified answer
    Henry J. Profile Picture
    Henry J. 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

  • GiridharRaju Profile Picture
    GiridharRaju 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

  • Suggested answer
    Henry J. Profile Picture
    Henry J. 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
    GiridharRaju 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
    Henry J. 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

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 Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,514 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans