Show or Hide header/footer and ribbon menu dynamically in Dynamics 365 Model Driven App forms
Now we have an API which allow you to do just that and in-fact much more. But before we go ahead and explore the API’s available, let’s explore the section of the header the API help us interact with.
There are primarily 3 methods which are important here.
- getCommandBarVisible/ setCommandBarVisible
- getBodyVisible/ setBodyVisible
- getTabNavigatorVisible/ setTabNavigatorVisible
use the syntax as below
formContext.ui.headerSection.setCommandBarVisible(false);
formContext.ui.headerSection.setBodyVisible(false);
formContext.ui.headerSection.setTabNavigatorVisible(false);
For footer section also we can do as below:
formContext.ui.footerSection.getVisible();
formContext.ui.footerSection.setVisible(bool);