Hide Tab using a condition on a calculated text field

0
38
Role Image


Hello,

I am a newbee with Javascript coding.

I want to hide different form tabs based on a calculated text field. My code doesn’t seem to work. Can someone help me?

Here’s my code:

function changeTab(executionContext)
{
var formContext = executionContext.getFormContext(); 
var accountclass = formContext.getAttribute(“gs_accountclass”).getValue();
var tabObj = formContext.ui.tabs.get(“agreement”);
var tabObj2 = formContext.ui.tabs.get(“quotes”);
tabObj.setVisible(false);
tabObj2.setVisible(false);

if (accountclass == “Class1”)
{
tabObj.setVisible(true);
tabObj2.setVisible(true);
}
else if (accountclass == “Class2“){
tabObj.setVisible(false);
tabObj2.setVisible(true);
}
else if (accountclass == “Class3“){
tabObj.setVisible(false);
tabObj2.setVisible(true);
}
}



Source link

Leave a reply

Please enter your comment!
Please enter your name here