
Hello,
I have a subgrid that is found in the same entity twice, but I need to put an enable rule so that new and add existing are hidden on "Job description."
I am trying to create a custom enable rule using js to hid the fields on this specific tab. I am trying to get the name of the current page were the user selected to be able to return true and false values based on it.
I can't find a way to get the current selected tab using javascript.
Thank you!
Hi Mbaba,
Please find below the sample script. Hope this will help you to configure.
function showHideDescriptionTab(formContext) {
switch (formContext.getAttribute("casetypecode").getValue()) {
case 1:
formContext.ui.tabs.get("Description").setVisible(true);
formContext.ui.tabs.get("Incident_Details").setVisible(false);
break;
case 2:
formContext.ui.tabs.get("Incident_Details").setVisible(true);
formContext.ui.tabs.get("Description").setVisible(false);
break;
default:
formContext.ui.tabs.get("Description").setVisible(false);
formContext.ui.tabs.get("Incident_Details").setVisible(false);
}
}
If you find this answer helpful, please mark it verified.