ANS-0217 · SUITESCRIPT DEVELOPMENT

Why Can’t NetSuite Scripts Show UI-Hidden Fields in beforeLoad?

Understand the limitations of setDisplayType in NetSuite's beforeLoad script when managing UI-configured field visibility.

Short answer

When using setDisplayType in a NetSuite beforeLoad script, a field initially configured as hidden in the UI cannot be made visible. However, setDisplayType can successfully hide a field that was originally set to normal or inline visibility in the UI.

Scenario

NetSuite users attempting to dynamically control field visibility via client scripts may encounter unexpected behavior. Specifically, a common challenge arises when a script tries to display a field that was initially configured as hidden through the NetSuite user interface.

Solution

When working with NetSuite client scripts, it is important to understand the interaction between UI field configurations and script-based visibility controls. In a beforeLoad script, attempting to show a field by script using setDisplayType will not work if that field was originally created using the UI and set to hidden. Conversely, it is possible to successfully hide a visible field using setDisplayType, even if the field was created using the UI and set to normal or inline.

Expert NetSuite Support

Need help with this NetSuite issue?

SuiteScript Development consulting and configuration support

Talk to a consultant