Hello,
I would like to get help to hide or delete an option in the menu (here highlighted) of a subgrid in a form on Dynamics365.
Could you please guide me?
Hello,
I would like to get help to hide or delete an option in the menu (here highlighted) of a subgrid in a form on Dynamics365.
Could you please guide me?
Thank you very much for your advice and saving time
Don't try to do what it says by Expertopinionsa12, its a Chat GPT response with wrong content. Probably created to advertise his site.
1. getMenu() doesn't exist in a Grid Control.
2. removeOnLoad() removes an onLoad event handler, it doesn't add it.
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.
Hi Rafio,
I'm afraid it is not available for now to hide See all records button in subgrid directly.
However, we can replace the normal subgrid in the reference panel.
Here are the steps:
1. We can go to Settings > Customization > Customize the System > Entity > Select an entity.
2. Open the form you want to add the reference panel, click the Insert tab on the top > Select Section > Reference Panel.
3. Save and publish, after that See all records button will be hided in the subgrid.
It's noticed that a form can only have one reference panel.
You can also refer to this link: Dynamics 365: Reference Panel – Dynamics 365 Talk (d365goddess.com)
Best Regards,
Sayen Zhang
Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.
Hi,
Can you try this: www.dynamicsforcrm.com/.../
André Arnaud de Cal... 291,784 Super User 2024 Season 2
Martin Dráb 230,476 Most Valuable Professional
nmaenpaa 101,156