Hi, Rafio
It might sound challenging but trust me its not. To remove the "See all records" option from the subgrid menu in Dynamics 365, you will need to use JavaScript code to customize the form. Here's a step-by-step guide to achieve this:
Open the form customization page in Dynamics 365. You can do this by navigating to Settings > Customizations > Customize the System.
Find the form that contains the subgrid you want to modify and open it for editing.
Switch to the "Form" editor and select the subgrid control you want to modify.
In the Properties window, locate the "Event Handlers" section and click on "Add Row."
In the new row, select the "Event" as "OnLoad" and enter a unique function name in the "Function" field, such as "HideSeeAllRecords."
Save and publish the form customization.
Now, navigate to the "Customize the System" page again and open the "Web Resources" section.
Create a new web resource of type "JScript" and give it a unique name, such as "HideSeeAllRecords.js".
In the web resource editor, paste the following JavaScript code:
function HideSeeAllRecords() {
// Get the subgrid control
var subgrid = Xrm.Page.getControl("your_subgrid_name");
// Hide the "See all records" option from the subgrid menu
subgrid.removeOnLoad(function () {
var menuItems = subgrid.getMenu().Items;
for (var i = 0; i < menuItems.getLength(); i ) {
if (menuItems.get(i).getLabel() === "See all records") {
menuItems.remove(menuItems.get(i));
break;
}
}
});
}
Make sure to replace "your_subgrid_name" with the actual name of your subgrid control. You can find the name by inspecting the subgrid element on the form customization page.
-
Save and publish the web resource.
-
Go back to the form customization page and open the form for editing again.
-
In the "Event Handlers" section of the subgrid control, set the "Library" to the web resource you created ("HideSeeAllRecords.js") and the "Function" to the function name you entered ("HideSeeAllRecords").
-
Save and publish the form customization.
Once you have completed these steps, the "See all records" option should be removed from the subgrid menu when the form loads. If that didn't help you can sonsult an expert of Dynamics 365. You can ask me anything regarding this.