Hello,
How can I hide the add new button on related subgrid when the form is readOnly.
I have tried the following but it does not seem to work for me
Thanks in advance
Hello,
How can I hide the add new button on related subgrid when the form is readOnly.
I have tried the following but it does not seem to work for me
Thanks in advance
thanks!
Hi Ainsley,
You can do this by adding enable rule for + or Add New Button.
Js code:
function DisableSubGridNewButton() {
if (Xrm.Page.ui.getFormType() == 3) // Read Only
return false;
else
return true;
}
Maybe you can refer following link:
(+) Hide SubGrid '+' / New Button button based on Parent status - Microsoft Dynamics CRM Community
Regards,
Leah Ju
Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.
Hi Ainsley,
You can do this by adding enable rule for + or Add New Button.
Js code:
function DisableSubGridNewButton() {
if (Xrm.Page.ui.getFormType() == 3) // Read Only
return false;
else
return true;
}
Maybe you can refer following link:
(+) Hide SubGrid '+' / New Button button based on Parent status - Microsoft Dynamics CRM Community
Regards,
Leah Ju
Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.
nope didnt work for me, im not sure if the subgrid is aware of the parent.context
Hi,
Thank you for your query.
Use Enable Rule (instead of Display Rule).
Also, here is a related post (it does something else, but you will get some idea):
Unlocking “add new” on the subgrids for read-only records | It Ain't Boring (itaintboring.com)
André Arnaud de Cal... 291,703 Super User 2024 Season 2
Martin Dráb 230,433 Most Valuable Professional
nmaenpaa 101,156