I am converting old XRM code to work on UI and I can't seem to get the loops nested right. Rather than just looping through controls and hard coding the section name "PERSONALINFORMATION" name, how can I just give the tab name "ContractTerms" then automatically loop through all sections and controls under that tab?
Here is what I have:
function OnLoad(executionContext)
{
let formContext = executionContext.getFormContext();
formContext.ui.tabs.get('ContractTerms')
.sections.get('PERSONALINFORMATION')
.controls.forEach((e) => e.setDisabled(true));
}