I am adding a button by workflow. Later I want to hide that button, using a server script. In order to do that, I need the button's internal ID, how to get the internal id of a button in netsuite?
I am adding a button by workflow. Later I want to hide that button, using a server script. In order to do that, I need the button's internal ID, how to get the internal id of a button in netsuite?
In my case created a form with text field to store a value and hiding the field. This may help
var form = serverWidget.createForm({
title: 'Simple Form'
});
var field = form.addField({
id: 'custpage_file',
type: 'file',
label: 'Upload CSV'
});
form.addSubmitButton({
label: 'Submit'
});
var textfield=form.addField({
id : 'custpage_vendor_id',
type : 'text',
label : 'Text',
value :'Text'
});
textfield.defaultValue = 123;
textfield.updateDisplayType({
displayType : serverWidget.FieldDisplayType.HIDDEN
});
context.response.writePage(form);
If you want to find the ID, you can simply right click on the button and click on Inspect (Microsoft Edge or Chrome).
In the dialog box opened, you can check for the field id and you will get the ID of the button.
Something like -
Give this a try. Let me know.