Is it possible to hide subtab with UE script's bef...
# ask-stanley-ai
s
Is it possible to hide subtab with UE script's beforeLoad function?
c
AI generated answer (using internal Slack threads):
Yes, it is possible to hide a subtab with a User Event (UE) script's beforeLoad function. You can achieve this by getting the form from the context, then getting the sublist you want, and setting its displayType property to hidden. Here is a sample code snippet:
Copy code
javascript
define(['N/ui/serverWidget'], function(ui) {
    const beforeLoad = (context) => {
        const form = context.form;
        form.getSublist({id: '[sublist_id]'}).displayType = ui.SublistDisplayType.HIDDEN;
    }

    return {
        beforeLoad: beforeLoad
    }
})
However, please note that this will hide a sublist, not a subtab. If you want to hide a subtab, you might need to consider other options, such as using a custom form that has the subtab setup to not show. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.841820717
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.835623
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.835554779
Please provide your feedback on this answer.