Internal ID of Button - Netsuite

Viewed 221

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?

2 Answers

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 -

enter image description here

Give this a try. Let me know.

Related