Skip to main content

Dynamics Quick V9 – Hide/Show Section in Js

Quick reusable javascript code for showing or hiding a section in dynamics. Replace tabName and sectionName strings in the function call as needed. Don’t forget to pass the execution context to the script.


function onLoad(executionContext) {
//get form context
var formContext = executionContext.getFormContext();

//show section
setVisbility(formContext, "tabName", "sectionName", true);
//Hide section
setVisbility(formContext, "tabName", "sectionName", false);

function setVisbility(formContext, tabName, sectionName, vis) {
var tabObj = formContext.ui.tabs.get(tabName);
var sectionObj = tabObj.sections.get(sectionName);

Charles Osei

Dynamics 365 Consultant @ Hitachi MCSE Business Applications Computer Science – University of Lincoln 2017 Nottingham D365/CRM user group Chapter Leader TDG – Community leader Twitter @charlied3v LinedIn

Leave a Reply