
Lets say I want to hide one of the tabs in a so called "multi-attribute cell" (the red one) based on a yes/no field in SystemSettings.
If it was a form section (blue tabs), this would be piece of cake. I would just have to use "Not present when" and point it to a SystemSettings attribute like: SystemSettings.ShowTechnicalObservations<>'Yes'
But because this is a "multi-attribute cell" setting, there is no such option.
Presentation rules: They are only for grid rows.
READ PROTECT rules: Will only hide records of a BO, not a tab.
So what we are left with is javascript and CSS.
This is what we came up with:
Set the icon class for the tab which you want to conditionally hide like: fa fa-table technicalObservations
This is so that we have some sort of way to refer to the correct tab.
Use a render script for the form: (credit: Margor)
let variable='<<SystemSettings.ShowTechnicalObservations>>'
if(variable!='Yes'){
$( "span:has(.technicalObservations)" ).addClass( "hideIt" );
}
- Write this in the CSS file for the application:
/*Code for hiding stuff*/
.hideIt{display:none !important;}
/**/
This will work, but it feels like there should be a simpler way to do it. Am I missing something?