Deepan Murugan Deepan Murugan - 1 year ago 120
Javascript Question

Is there any way to Disable (or) Remove the Netsuite Standard Edit Button on the View Mode of the Custom Record

I want to disable (or) Hide the standard "Edit" Button on the View Mode of the Custom Record Type. Instead Of Standard Button i have used custom button to access the edit page of the record to particular users. So i want to disable the standard edit button.

My Code:

Script Version: Suite Script 2.0

Client Script

function pageInit(scriptContext) {

var approved = 3;
var currentRecord = scriptContext.currentRecord;
var status = currentRecord.getValue("custrecord_lst_ch_status");
//Hiding The Standard Edit Button When the Status Field is in Approved State
if (status == approved) {
document.getElementById("edit").disabled = true;
document.getElementsByName("edit")[0].disabled = true;

I'm unable to get the ID of the "Edit" Button. It is getting the NULL value.

It is Possible to Disable (or) Hide on the view mode of the record using client script (or) User Event Script.

Thanks in advance.

Answer Source

Version: SuiteScript 2.0

USER Event Script Before Load Event:

if (context.type == context.UserEventType.VIEW) {
    var form = scriptContext.form ;
               id :'edit',