Learn how to Hide NetSuite Sublist Buttons and Other HTML Elements

This article is relevant if you want to hide some buttons and other HTML elements on NetSuite forms.


NetSuite’s point-and-click customization system is generally good for giving administrators the ability to change the NetSuite presentation layer. However, recently, a client came to us asking a simple question:

"How can I remove the buttons on the Invoice > Communication Sub Tab?  I want to remove:
Customize View"

Fortunately, I have experienced members on our team that have strong fundamental web and database development skills. Thus, they know how to answer these kinds of questions.

These specific sublist buttons are not available for removal via the point-and-click customization. You often can hide the entire tab — but many times, that is not what we want to do. We just need more refined control over the situation.

How to Hide NetSuite User Interface Elements

While NetSuite does not recommend you modify the user interface without using its built-in tools and libraries, there are times when we must take matters into our own hands. We must always remember that the NetSuite client presentation layer is (complex) HTML and thus we can use client-side JavasScript to get control. This kind of browser programming is called Document Object Model (DOM) which provides the API layer to make HTML interactive. As such, all we need to is know a few key things:

  1. JQuery: NetSuite provides a reference to the JQuery add-in library by default. Thus it is convenient for DOM operations.
  2. HTML IDs: We need to know the IDs of the target HTML elements we want to manipulate.
  3. Script: We need to inject some client-side JavaScript into the HTML to get ultimate control.

Click on related images to learn how to discover the names of the buttons that you want to hide.

NetSuite Client Side 2.0 Script to Hide Buttons

Below is a NetSuite beforeLoad script to create a hidden HTML field that allows you to inject client-side JavaScript that will then find the buttons and use CSS to change the visibility to hidden via JQuery.

//create an inline html field
var hideFld = context.form.addField({
	label:'not shown - hidden',
	type: serverWidget.FieldType.INLINEHTML

//for every button you want to hide, modify the scr += line
var scr = "";
scr += 'jQuery("#print").hide();';
scr += 'jQuery("#addmessage").hide();';
scr += 'jQuery("#addcontact").hide();';

//push the script into the field so that it fires and does its handy work
hideFld.defaultValue = "<script>jQuery(function($){require([], function(){" + scr + ";})})</script>"

Get Expert NetSuite Customization Help

In my mind, one of the major reasons NetSuite is so valuable is that we can enhance the system to address our business concerns. Even if NetSuite does not expose every business element for manipulation, there is sufficient room to be creative to “get the job done”. If you have a NetSuite challenge and you need strong professionals who will listen, understand, invent and deliver on innovations, let’s have a conversation.

Be Sociable, Share!

Marty Zigman

Holding all three official certifications, Marty is Southern California's NetSuite expert and leads a team of senior professionals at Prolecto Resources, Inc. He is a former Deloitte & Touche CPA and has held CTO roles. For over 25 years, Marty has produced leadership in ERP, CRM and eCommerce business systems. Contact Marty to set up a conversation.

More Posts - Website - Twitter - Facebook - LinkedIn - Google Plus - YouTube

| Category: NetSuite, Technical | 4 Comments


  1. Steven
    Posted November 29, 2018 at 11:59 pm | Permalink

    Hey Marty,

    I tried this out, but I’m getting the following error:

    TypeError: Cannot read property “FieldType” from undefined (/SuiteScripts/hide_buttons.js#13)

    Line 13 is the var hideFld section. Thoughts?

  2. Posted December 1, 2018 at 1:04 pm | Permalink

    Hi Steven,

    You will need to use the browser inspection to see what is happening in your script if this is client side. Add console.log statements to help you step through your code. Yet, this looks like it may a server-side suitelet error. Thus, confirm you are actually connected to the context object in your definition. I suspect that you may not have set up your SuiteScript 2.0 Define and Require statements correctly.


  3. David
    Posted January 4, 2019 at 3:34 am | Permalink

    Hi Marty,

    Great thanks for you blog, it is very useful.
    We have a similar issue in our company. We need to hide the component sublist from the item forms and any transaction forms where this is shown as it contains very sensitive information and only a really small number of person can have access to this (read and/or write).
    Can we consider this in the same way?


  4. Posted January 5, 2019 at 3:55 pm | Permalink

    Hello David,

    Yes, you should be able to. The key to this is to be willing to find the elements you need and then use some DOM (via JQuery) commands to add custom CSS. Of course, there is some risk in this approach but that’s an assessment for you to make. I may write another article on this.


Post a Comment

Your email is never published nor shared. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>