Unable to hide section using ui policy or client script.

Rocky5
Kilo Sage

Hello Experts,

I need to hide 4 sections based on reference field value, I have written script in UI policy and sections are now hidden both onLoad and onChange based on that reference field value but, highlighted (red) section below is not hidden onLoad but it hides onChange with that UI policy. What could be the issue?

 

UI policy script:

function onCondition() {
g_form.setSectionDisplay('dates', false);
g_form.setSectionDisplay('financials', false);
g_form.setSectionDisplay('score', false);
g_form.setSectionDisplay('preferences', false); //This section is not being hidden onLoad like other 3 sections.

}

 

What could be the issue? Any thoughts? 

 

Thanks,

Rocky.

4 REPLIES 4

Uncle Rob
Kilo Patron

If its certain that the other 3 work, I'd check and recheck the spelling of the section name.  

Hi Robert,

 

I have checked and rechecked and also pulled section names in alert statement. The section name is fine but still couldn’t hide which is weird. Any other input ?

 

thanks,

Rocky

Karthick Nagara
Tera Expert

Hi 

Have you tried hiding a tab based on a field available inside it.

 

var tab_x = g_tabs2Sections.findTabIndex('<field name>');

g_tabs2Sections.hideTab(tab_x );

Yuqi
Tera Contributor

Hi,

 

I had the same issue and was able to fix it by adjusting the order for the 'preferences' UI-Policy to ensure that it is executed last.

 

Best,

Yuqi