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 :
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.
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
}
);
}
}
Customize the table ribbon CommandDefinition for OpenRecordItem to call the function above and include the CrmParameter with the value SelectedControlSelectedItemReferences.
<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
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.
else you can add a New tab on the form and show your custom page.
Thank you,
Amit Katariya
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/
Hi,
How to go to that ribbon workbench ? I'm sorry but I never use this and pretty blank about CRM
Thanks
Hello everyone,
Appreciate any thought on this.
Thanks
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 ->
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.
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.
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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156