Skip to main content

Notifications

Service | Customer Service, Contact Center, Fie...
Suggested answer

Alternate method for Xrm.Internal.openDialog in UCI form

Posted on by 35

Hi Experts,

   On button click on an entity , open a dialog with custom HTML controls (drop down and comments fields) . Save the dialog and capture the fields details on a entity . This is the requirement am working on . To achieve this i have used Xrm.Internal.openDialog method in classic form which works fine but on UCI form it did not worked as this method is unsupported . Do we have alternate method for Xrm.Internal.openDialog on UCI form ?

   I have tried xrm.navigation.openwebresource method on UCI form . But this method does not has callback function parameters. Hence want to know if there is similar method that supports on UCI form as below one . Appreciate your help on this .

Xrm.Internal.openDialog(Xrm.Page.context.getClientUrl() + "/WebResources/ipx_Lead/DisqualifyLead", DialogOption, null, null, callbackFunction);

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Alternate method for Xrm.Internal.openDialog in UCI form

    Hi,

    Use below code to pass the data

    var pageInput = {

           pageType: "webresource",

           webresourceName: "new_sample_webresource.htm",

          data: params

       };

    Parse the data in html page which was passed as Data parameter

    function getUrlParameters() {

    var queryString = location.search.substring(1);

    var params = {};

    var queryStringParts = queryString.split("&");

    for (var i = 0; i < queryStringParts.length; i++) {

    var pieces = queryStringParts[i].split("=");

    params[pieces[0].toLowerCase()] = pieces.length === 1 ? null : decodeURIComponent(pieces[1]);

    }

    return params;

    }

    If found helpful, Please mark my answer verified.

  • Yash Trivedi CRM Profile Picture
    Yash Trivedi CRM 335 on at
    RE: Alternate method for Xrm.Internal.openDialog in UCI form

    Hy, Bipin

    Thanks,Ya it's working now..i did the same way you mentioned but can you guild me how can i pass parameters along with open webresourece becasue first i have did it using "Xrm.Utility.openWebResource" for different example and it's worked for passing parameter to that web resource...

    i have also try above  reference give by Andrew..but i don't know where am i doing mistake...can you please guide me.

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Alternate method for Xrm.Internal.openDialog in UCI form

    Hi,

    You should only pass name of the webresource instead of passing with URL. See below example.

    var pageInput = {

       pageType: "webresource",

       webresourceName: "new_sample_webresource.htm"

    };

    var navigationOptions = {

       target: 2,

       width: 500, // value specified in pixel

       height: 400, // value specified in pixel

       position: 1

    };

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

       function success() {

               // Run code on success

       },

       function error() {

               // Handle errors

       }

    );

    Get the we resource name from html web resource page as shown in below image.

    CQ41.PNG

    If found helpful, Please mark my answer verified.

  • Yash Trivedi CRM Profile Picture
    Yash Trivedi CRM 335 on at
    RE: Alternate method for Xrm.Internal.openDialog in UCI form

    Hello Andrew,

    i did same thing which you mentioned above here is my code can you please correct me? where am i doing mistake.

    it give me page not found 404 error  i don't know where am i wrong? because with same url when i am try to open in other tab it is opening without any error.

    code:

    function qualifyLead(primaryControl)
    {
    debugger;
    //Passing parameters to webresource
    var leadId =Xrm.Page.data.entity.getId().replace("{", '').replace("}", '');
    //var addParams = "Param1=" + leadId + "&Param2=" + primaryControl;//custom parameter that you need in the modal dialog


    Xrm.Navigation.navigateTo({pageType:"webresource", webresourceName:"">xxx-dev.crm.dynamics.com/.../xxx_QualifyLead_Model"}, {target: 2, position: 1, width: {value: 50, unit:"%"}});
    }

    thanks & regards

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Alternate method for Xrm.Internal.openDialog in UCI form

    Hello,

    You can check Xrm.Navigation.navigateTo instead of Xrm.Internal.openDialog. Here is my post on that - butenko.pro/.../

  • Suggested answer
    ba365guy Profile Picture
    ba365guy 2,946 on at
    RE: Alternate method for Xrm.Internal.openDialog in UCI form

    Try:

    Please create a canvass app with appropriate fields (drop downs and comments) and use it as dialog

    (docs.microsoft.com/.../replace-dialogs

    No more custom dialog

    Some instructions in this link also might help: https://readyxrm.blog/2019/02/24/replacing-a-dynamics-365-dialog-with-an-embedded-canvas-powerapp/

    This is the way forward

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans