web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Need some help on Model-driven PowerApps

(0) ShareShare
ReportReport
Posted on by 405

Hello everyone,

Hope I'm in the right forum to ask some help. I currently working on Model-driven app which need to use Custom Page. I'm learning about calling Custom Page from Model-driven and ran into this page -> Navigating to and from a custom page in your model-driven app using client API - Power Apps | Microsoft Docs

This example uses the recordId parameter within the navigateTo function to provide the custom page with the record to use. The Param function within the custom page retrieves the value and uses the Lookup function to retrieve the record.

The steps are : 

  1. Create a web resource of type JScript and update the name parameter to be the logical page name. Add the following code to the web resource.

    JavaScriptCopy
    function run(selectedItems)
    {
        let selectedItem = selectedItems[0];
    
        if (selectedItem) {     
            let pageInput = {
                pageType: "custom",
                name: "<logical page name>",
                entityName: selectedItem.TypeName,
                recordId: selectedItem.Id,
            };
            let navigationOptions = {
                target: 1
            };
            Xrm.Navigation.navigateTo(pageInput, navigationOptions)
                .then(
                    function () {
                        // Handle success
                    }
                ).catch(
                    function (error) {
                        // Handle error
                    }
                );
        }
    }
    
  2. Customize the table ribbon CommandDefinition for OpenRecordItem to call the function above and include the CrmParameter with the value SelectedControlSelectedItemReferences.

    XMLCopy
        <JavaScriptFunction FunctionName="run" Library="$webresource:cr62c_OpenCustomPage">
            <CrmParameter Value="SelectedControlSelectedItemReferences" />
        </JavaScriptFunction>
    

I understood about step 1, but what is step 2 meant? at which object and where should I go, and what exactly I should do ? Please help.

Thanks

I have the same question (0)
  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Moderator on at

    Hello,

    It explains to provide the parameter to your JS code when user will click on the Button. Now this button can be present on Any ribbon like Main form, View level as well as Sub grid level. you will need to add this button depending on you requirement.

    Please follow below instructions for the same as I am adding a button on the Main form and passing this parameter to My JS.

    1. GO to ribbon workbench and open this button. then click on the command associated with this button.

    pastedimage1651735803840v1.png

    Can you let me know from where you want to open this custom page? Like on Sub-grid Button click or Form Button Click ?

    Thank you,

    Amit Katariya

  • Teevo Profile Picture
    405 on at

    Hi Amit,

    I'm actually want my Custom Page to be open when I'm clicking the row in the Model-driven View it self. Is this possible ?

    You know when we have this kind of View when choose some of the menu ->

    pastedimage1651736736701v1.png

    So in that specific record (row), it used to open it's form, but I've created a Custom Page for the record so I would like this one to be shown instead.

    Thanks for your reply.

  • Teevo Profile Picture
    405 on at

    Hello everyone,

    Appreciate any thought on this.

    Thanks

  • Teevo Profile Picture
    405 on at

    Hi,

    How to go to that ribbon workbench ? I'm sorry but I never use this and pretty blank about CRM

    pastedimage1651831749960v1.png

    Thanks

  • Verified answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    Hi,

    Unfortunately you can not achieve what you need. Hyperlink on View controled by internal microsoft code which we don't have access to.

    You should embedd your custom page inside CRM form/Add Ribbon button to let the user open your custom page.

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Moderator on at

    Hello,

    It is limitation of the CRM. Because this settings are OOB and it is handled by the CRM internally.

    I guess you can use Modal forms which can open as a popup in the same page. if you have records on the main form.

    knowledgefrommanish.com/.../

    else you can add a New tab on the form and show your custom page.

    Thank you,

    Amit Katariya

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 192 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 129

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans