Hi everyone,
Does anyone know if it possible to hide a ribbon button using Ribbon workbench based on the active/selected tab on a main form?
For example, if the user selects the "Business Case" tab, hide the Save button
best regards,
Hi everyone,
Does anyone know if it possible to hide a ribbon button using Ribbon workbench based on the active/selected tab on a main form?
For example, if the user selects the "Business Case" tab, hide the Save button
best regards,
Did you add "CRM Parameter = PrimaryControl" in the enable rule ? isEnabled function needs it.
Thank you very much Xavier Monin
I am not receiving any errors so I think the java script is correct, but I suspect I have missed a step somewhere in Ribbon workbench, because the Save button remains enabled on the specified tab.
Context
I want to hide the Save button on the ribbon if the selected tab is “Business Case”
Applied steps
Hello,
You can do this by adding a Custom Enable Rules to the command of the button.
The custom enable rule is a JS function that will show/hide the button by checking the current tab name :
function isEnabled(formCtx) { const currentTab = formCtx.ui.tabs.get().find(t => t.getDisplayState() === "expanded"); return currentTab?.getName() === "tab_2"; }
Replace tab_2 by your tab name.
Next, you need to refresh the command bar when you switch tabs.
To do this, subscribe to the "tabStateChange" event on the tabs and call a JS function that does :
function refreshRibbon(execCtx) { const formCtx = execCtx.getFormContext(); formCtx.ui.refreshRibbon(false); }
André Arnaud de Cal...
292,468
Super User 2025 Season 1
Martin Dráb
231,287
Most Valuable Professional
nmaenpaa
101,156