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
Open from a grid primary field link as a full page with record ID
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.
JavaScriptCopyfunction 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.
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