Modal Popups in CE – Xrm.Navigation.navigateTo – Dynamics 365 CE

Hi Everyone,

Today I was browsing something and came to know that one of the awaiting feature from many years has been released.

Many times we get the requirement to open something in Modal Popup and we all know that was no way to do that. We have that know OOB.

We just have to use the below code for it. 

var pageInput = { pageType: “webresource”, webresourceName: “WebResourceName” };
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
    }
);

Along with this, we can use NavigateTo to navigate to Dashboards, Views. Use PageInput as below for the same.

  // Navigates to the Entities Default View.
    var pageInput = { pageType: “entitylist”, entityName: “contact”, viewId:“3a282da1-5d90-e011-95ae-00155d9cfa02” };
    // Navigates to the View that is mentioned in the ViewID.
    var pageInput = { pageType: “entitylist”, entityName: “contact”, viewId:“3a282da1-5d90-e011-95ae-00155d9cfa02” };
    // Navigages to the specified Dashobard
    var pageInput = { pageType: “dashboard”, dashboardId: “45f88f83-0e67-443b-bd05-81d49719f6b1” };

Link from Microsoft Docs


Hope this helps.


Happy 365’ing

Gopinath

3 thoughts on “Modal Popups in CE – Xrm.Navigation.navigateTo – Dynamics 365 CE

  1. Unknown November 28, 2019 / 1:29 am

    It's almost great – but how do we close the modal? Been struggling with a clean way to do that, and closing it with the X at the top right isn't a great option. The other default dialogs have buttons – why not here?

    Like

  2. Gopinath November 28, 2019 / 1:56 pm

    Very unfortunately as of now, no API support is available for closing the popup. Hope, will get that support soon.

    Like

  3. Bhuvita March 9, 2020 / 6:12 am

    entity list is not getting open in modal dialog

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s