What is a form header in Dynamics 365?
The header section in Microsoft Dynamics 365 is been displayed at the upper right corner of main form screen. It displays information that a user may want to see consistently when viewing a form and scrolling which usually includes critical fields such as owner, name etc.
Why do we need to dynamically hide / show headers?
Consider a business scenario where we need to hide and show the header section as per the input provided by the end-user. We can achieve this requirement with help of the below given procedure.
Using setBodyVisible (Client API reference) to hide / show the header –
We will use the setBodyVisible (Client API reference) to dynamically change the visibility of form header section.
formContext.ui.headerSection.setBodyVisible(bool);Sets the header’s body visibility.
Note: – This method is supported only on Unified Interface.
Validate the output in Dynamics 365 form –
Once deployed, verify if you are able to dynamically hide / show the header based on the given input as shown below.