Sciuridae54696d
12/09/2021, 5:50 AMdefine(['N/record','N/runtime'], function(record,runtime) {
function beforeLoad(context) {
var form = context.form;
form.removeButton('newmessage');
return true;
}
return {
beforeLoad:beforeLoad
};
});
doesn't work as 2.x? (I deployed it on the quotation record and it didn't hide as the button)battk
12/09/2021, 6:22 AMNElliott
12/09/2021, 8:39 AMSciuridae54696d
12/09/2021, 9:05 AMredfishdev
12/09/2021, 12:42 PMredfishdev
12/09/2021, 12:42 PMconst beforeLoad = (scriptContext) => {
//create an inline html field
var hideFld = scriptContext.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("#print").hide();';
scr += 'jQuery("#attach").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>"
}