I want to prevent create a new record from my sub-grid of email entity (it's a custom view/subgrid), I tried to change it using ribbon workbench -> sub-grid ribbon, but I have many views to my Entity.
How do I know that I'm working on the right addnew
button and not on unwanted subgrid or by mistake deleting the addnew
button from all of my sub-grids?
From ribbon workbench or directly in ribbondiff xml, you can hide the (+) Add New button in all subgrids of that particular entity when customizing entity ribbon. It’s nothing to do with selected custom view or any particular form.
Make sure you hide the + ADD NEW {0}
button with CommandCore AddNewRecordFromSubGridStandard
. Other one, + NEW{0}
button is used within associated view.
Hide it so you can Unhide it again. Don’t delete it.
If you want to hide for some particular scenario, then probably some unsupported DOM manipulation can hide it in subgrid onload js.
In version 8.1 the selector for the commands of a subgrid is '#titleContainer_SUBGRIDNAMEHERE a'
.
If you try to do it OnLoad
, I suggest you use setInterval
to accomodate for the form load times (subgrids are loaded asynchronously).