How to hide a button in a .nl page a non-scripted ...
# ask-stanley-ai
n
How to hide a button in a .nl page a non-scripted record
c
AI generated answer (using internal Slack threads):
To hide a button in a .nl page for a non-scripted record, you can use a ClientScript with jQuery to hide the button. Here is an example of how you can do this:
Copy code
javascript
/**
 * @NApiVersion 2.x
 * @NScriptType ClientScript
 */
define(['N/search'], function(search) {
    return {
        pageInit: function(context) {

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

            //for every button you want to hide, modify the scr += line
            var scr = "";
            scr = 'jQuery("#newrecrecmachcustrecord_volumesubprojectparent").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>"
        }
    }
});
In this example, the button with the id
newrecrecmachcustrecord_volumesubprojectparent
is being hidden. You would replace this id with the id of the button you want to hide. Please note that this method is not officially documented by NetSuite and may not work for all buttons, especially those not listed in the NetSuite help center under "Button IDs". For those buttons, you may need to use a different method, such as modifying user permissions or workflows. ****** 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.821289122
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.819885254
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.813171446
Please provide your feedback on this answer.