Showing results for 
Search instead for 
Did you mean: 

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

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();





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 🙂




Can we hide specific command button inside command bar using java script in view mode and not in form mode ?

Hi @Arpit1991 ,


Yes, you can write a custom JS to get the Form type and Achieve it

Would this work for a subgrid's command bar that is on a form? What would the JS change look like?

No it won't work for SubGrid

😓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)