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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

how to create dialog in UCI

(0) ShareShare
ReportReport
Posted on by 35

Hi Experts ,

       I  have custom button (Disqualify Lead) that calls html web resource(as shown below ) on classic mode which is working as expected .

       However it is not working on UCI mode as dialogs got deprecated . Is there a supported way on UCI where i can implement the similar feature that capture the html fields data back to the CRM form on click of "OK" button .  Appreciate your response on this .

pastedimage1586503931775v1.png

I have the same question (0)
  • Suggested answer
    Marco.P Profile Picture
    2,405 on at

    Hi,

    you can use Xrm.Navigation.navigateTo and as entitytype web resource.

    Please refer to this:

    https://carldesouza.com/using-the-new-modal-dialog-to-open-forms-in-dynamics-365-using-xrm-navigation-navigateto/

    Hope it helps,

    Marco

  • harish c Profile Picture
    35 on at

    Hi ,

    I have tried all the mentioned blog before posting the question in community .However i would need to pass html fields data back to lead form and close the page automatically which is not working . appreciate if you are aware of how to implement this ?

    Thanks in advance.

  • Suggested answer
    Marco.P Profile Picture
    2,405 on at

    I haven't tried it yet, but this is what i would do:

    1) try to pass the id of the record to the web resource

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-navigation/navigateto

    HTML web resource

    The object contains the following attributes:

    • pageType: String. Specify "webresource".
    • webresourceName: String. The name of the web resource to load.
    • data: (Optional) String. The data to pass to the web resource.

    2) Inside the web resource add a button and perform an update with the webresource filled in fields

    3) On callback (Xrm.Navigation.navigateTo(pageInput,navigationOptions).then(successCallback,errorCallback)) add a refresh page function (so when a user will close de dialog you will be able to see the updated field

    • Suggested answer
      a33ik Profile Picture
      84,331 Most Valuable Professional on at

      Hello,

      I described potential ways on how to Close dialog that is being opened in my post - butenko.pro/.../

      I work on video on how to create dialogs for UCI interface that includes passing parameters to dialog and getting the results of the back back so if you don't want to miss it - subscribe to my twitter/blog/youtube channel.

    • harish c Profile Picture
      35 on at

      Hi Andrew,

        Thanks for the post . Looking forward for the video on how to create dialogs for UCI interface that includes passing parameters to dialog and getting the results back .

      I have one question related to the getting lead id and pass the same to the navigate function as shown below :

      currently am getting lead id in classic approach which is working fine . Do you know the alternate way of getting the lead id as xrm.page is unsupported in UCI mode ? Appreciate your help on this .

      var id = Xrm.Page.data.entity.getId();

      var pageInput = {

         pageType: "webresource",

         webresourceName: "testribbon",

         data: encodeURIComponent(id)

      }

      I have tried below method to retreive lead id . However  i did not see any method that has lead id .

      Any help is highly appreciated .

      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("=");

      Regards,

      Harish Ch

    • Marco.P Profile Picture
      2,405 on at

      Hi,

      this should work:

      //Get the form context

      var formContext = executionContext.getFormContext();

      //Get the current Record Guid

      var recordGuid = formContext.data.entity.getId();

      Anyway if you're calling the webresource from a custom button, using ribbon workbench you can pass the record id directly to your function. Just pass FirstPrimaryItemId or FirstSelectedItemId (for subgrid).

    • harish c Profile Picture
      35 on at

      Hi ,

      Unfortunately firstprimaryitemid did not worked . After exploring , primarycontrol  argument worked fine.

    • Marco.P Profile Picture
      2,405 on at

      Hi Harish,

      Any news? Did you try the proposed solutions?

    • PhuocLV Profile Picture
      347 on at

      2020_2D00_04_2D00_24_5F00_22h43_5F00_33.gif

      Did you looking this OOB dialog ?

    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 > Customer experience | Sales, Customer Insights, CRM

    #1
    Tom_Gioielli Profile Picture

    Tom_Gioielli 70 Super User 2025 Season 2

    #2
    Gerardo Rentería García Profile Picture

    Gerardo Rentería Ga... 33 Most Valuable Professional

    #3
    Daniyal Khaleel Profile Picture

    Daniyal Khaleel 32 Most Valuable Professional

    Last 30 days Overall leaderboard

    Product updates

    Dynamics 365 release plans