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);
}
}