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);
sectionObj.setVisible(vis);
}

Charles Osei

Dynamics 365 Consultant @ RSM MCSE Business Applications Computer Science – University of Lincoln 2017 Nottingham D365/CRM user group Chapter Leader TDG – Community leader Twitter @charliedevxyz LinedIn https://www.linkedin.com/in/charlesosei/

Leave a Reply

%d bloggers like this: