Thursday, September 16, 2021

Show or Hide Command Bar using JavaScript in DataVerse/ Dynamics 365

 

Introduction:

In this Blog we will see how to show or hide Command bar using JavaScript in Both Dataverse/Model Driven Apps/ CRM


Below is the Sample Screen Shot for Command bar



If we want to hide any button or edit command we can use RIBBON Workbench or Customize Using XML. But there is no other functionality for hiding whole Command Bar.

To recover from this Situation Microsoft introduced a new Feature for Show or Hide functionality


Script to Use:

formContext.ui.headerSection.setCommandBarVisible(BOOLEAN);


To Utilize in script

function showOrHideCommandBar(executionContext)

{

var formContext = executionContext.getFromContext();

formContext.ui.headerSection.setCommandBarVisible(false); // True to enable // False to hidden

}


That's it :)

No comments:

Post a Comment

Day 11 - Customizing Option Sets Dropdown Fields with JavaScript

  In this Blog, we will see how to Customizing Option Sets Dropdown Fields with JavaScript label1 = formContext.getAttribute( "bosch_op...