Hide Command Bar using JavaScript in Model Driven App
Implementation Steps:
When ever you tried to create a new Record, you will be redirected to a page like below
Red Color Highlighted Called Command Bar
If we want to hide that Command Bar follow below steps to achieve the same.
1. Navigate to https://make.powerapps.com
2. Click Solutions --> Create a new Solution
3. Click New --> Click More --> Select Web Resource and add a new Web Resource
4. Write below code in Web Resource
function onLoadHideCommandBar(executionContext) {
var formContext = executionContext.getFormContext();
formContext.ui.headerSection.setCommandBarVisible(booleanValue);
}
booleanValue : pass true or false as an option
true - visible Command bar
false - hide Command bar
Once Code Published:
Load or Open a new Record
Now you cannot see the Navigation Bar.
That's it 🙂
Comments
-
Hide Command Bar using JavaScript in Model Driven App
😓Well, if you ever see a way to hide command buttons with JS or the whole command bar for a subgrid on the form, we would be greatly appreciative 😁
(the reason we can't accomplish this with ribbon workbench is that its for the Notes(annotation) entity which does not allow edits) -
-
Hide Command Bar using JavaScript in Model Driven App
Would this work for a subgrid's command bar that is on a form? What would the JS change look like?
-
Hide Command Bar using JavaScript in Model Driven App
-
Hide Command Bar using JavaScript in Model Driven App
Can we hide specific command button inside command bar using java script in view mode and not in form mode ?
*This post is locked for comments