Hi all!
I have been scratching my head and scouring the forums for an answer to this. I have tried multiple options that I have seen on forums but nothing seems to be working for me.
In my form I want to show/hide tabs based on the provider (cr6fc_provider) that has been selected.
Below is the JS code:
function onSupplierChange(executionContext) {
var formContext = executionContext.getFormContext();
var providerLookupName = formContext.getAttribute("cr6fc_provider").getValue()[0].id;
if(providerLookupName == "fc5d1173-7d42-ee11-bdf3-002248a1f770")
{
formContext.ui.tabs.get("tab_365smartfridge").setVisible(false);
formContext.ui.tabs.get("tab_systopia").setVisible(true);
}
if(providerLookupName == "ad5d1173-7d42-ee11-bdf3-002248a1f770")
{
formContext.ui.tabs.get("tab_365smartfridge").setVisible(true);
formContext.ui.tabs.get("tab_systopia").setVisible(false);
}
else
{
formContext.ui.tabs.get("tab_365smartfridge").setVisible(false);
formContext.ui.tabs.get("tab_systopia").setVisible(false);
}
}
I have applied this to the form as below image shows:

Is there something obvious here that I am missing? Please help 😄
Thanks!