Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Answered

How to launch Custom Page modal dialog from an editable subgrid

Posted on by 95

I'm trying to open a modal dialog from an editable subgrid.  The function is successful, yet the dialog is not launched.  The following is the code:

function OpenModal(executionContext) {
    debugger;
     
    // Inline Page
var pageInput = {
    pageType: "custom",
    name: "PolicyCommissionModal"
};
var navigationOptions = {
    target: 2,
    position:1,
    width: {value:50, unit:"%"},
    title: "Policy Commission Form"
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions)
    .then(
        function success() {
            console.log("success");
        }
    ).catch(
        function (error) {
            console.error(error);
        }
    );
}

Can we open Custom Pages as a modal from a subgrid?

  • Verified answer
    MZ_980 Profile Picture
    MZ_980 95 on at
    RE: How to launch Custom Page modal dialog from an editable subgrid

    To reference the answers posted, I did add the custom page to my app.  That was why I was asking what was being referred to meaning if there was another step that I missed after adding the custom page to my app.

    The problem was that I was using the display name instead of the name of the custom page in my code above.  Once I made the change, I was able to launch the modal.  

  • Abby Kong Profile Picture
    Abby Kong 4 on at
    RE: How to launch Custom Page modal dialog from an editable subgrid

    Went through similar issue with you recently :) as Andrew described, we need to include the custom page in the Model-Driven App for the custom page popup to show.

    1. From your solution, find the MDA and edit it (The type of the solution component should be Model-Driven App)

    2. Add Page 

    pastedimage1673402462031v1.png

    3.Choose and find your existing custom page, you can un-tick Show in Navigation

    4.Publish app

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,321 Most Valuable Professional on at
    RE: How to launch Custom Page modal dialog from an editable subgrid

    Solution and app (model-driven app) are different things. In order to make your code work the way you want you to have to add your custom page to the model-driven app you want to call it in.

  • MZ_980 Profile Picture
    MZ_980 95 on at
    RE: How to launch Custom Page modal dialog from an editable subgrid

    I'm not sure what you are referencing.  It's a page within the same solution that my form is in.  Is there another thing I need to do to launch the custom page?

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,321 Most Valuable Professional on at
    RE: How to launch Custom Page modal dialog from an editable subgrid

    Hello,

    Doublecheck that your custom page is added to the app you're trying to launch it from.

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,558 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,647 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans