Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

How to launch Custom Page modal dialog from an editable subgrid

(0) ShareShare
ReportReport
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 6 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,325 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,325 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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans