Dynamics 365 – How to Show/Hide Sections and Form tabs

Just like attributes, tabs and sections are also controllers of the forms in Dynamics 365. You can apply same logic to show and hide those controls by using Javascript.

For the tabs; you need to know unique name of the tab you are going to show/hide.
For the sections, you need to know unique name and tab name which that section belongs to.

How to find tab and section names:
From the Form editor you can find section and tab names easily. Just select the Tab and Section components in your classic or modern Form editor.

Code

projectTaskSection: function (executionContext) {
let formContext = executionContext.getFormContext();
//get tab
let tabObj = formContext.ui.tabs.get("tab_name");
//get section
let sectionObj = tabObj.sections.get("section_name");
//show the tab
tabObj.setVisible(true);
//show the section
sectionObj.setVisible(true);
//hide the tab
//hide the section
tabObj.setVisible(false);
sectionObj.setVisible(false);
}

One response to “Dynamics 365 – How to Show/Hide Sections and Form tabs”

  1. […] name of the tab you are going to show/hide.For the sections, you need to know unique name and … Continue reading Dynamics 365 – How to Show/Hide Sections and Form tabs Read Complete Post and Comments SBX – Two Col […]

Leave a comment