Skip to content

Instantly share code, notes, and snippets.

@DynCon365
Created August 11, 2020 21:29
Show Gist options
  • Save DynCon365/b80d7b127fe36b7361074fac5360985b to your computer and use it in GitHub Desktop.
Save DynCon365/b80d7b127fe36b7361074fac5360985b to your computer and use it in GitHub Desktop.
Dynamics 365/CRM 9.0+ | Show/hide form sections
//-------------------------------------------------------------------------------------------
// showHideFormSections
//-------------------------------------------------------------------------------------------
// Consider using Business Rules before using this code
function showHideFormSections(e){
// Get the Form Context
var formContext = e.getFormContext();
// Create variables for the tab an section
var tab=formContext.ui.tabs.get("TabName");
var section = tab.sections.get("SectionName");
// Hide a section
section.setVisible(false);
// Show a section
section.setVisible(true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment