Adding Button Action in User Event Script

In order to open a suitelet form when a custom button is clicked, we must create a client script to handle the action.

In addition, without creating additional client script, we could add button actions within the User Event script.

As a result, we can reduce the number of scripts.
The example that follows,

var script = “window.open(‘” + customerStatementformURL + “‘,’_blank’).focus();”;
var objForm = context.form;
objForm.addButton({
id : ‘custpage_fbn_printstatement’,
label : ‘Print Customer Statement’,
functionName : script
});

Leave a comment

Your email address will not be published. Required fields are marked *