ANS-1180 · CUSTOM FIELDS, RECORDS & FORMS
How to Add a Custom Button to a NetSuite Record Form Using a Formula Field
Learn to embed an interactive button on a NetSuite customer record form by leveraging a Formula (Text) field with HTML and JavaScript.
Short answer
A custom button can be displayed on a NetSuite record form by entering a specific HTML and JavaScript formula into a Formula (Text) field. This method creates a clickable image that opens a new window, linking to a specified NetSuite page or media file, offering a direct navigation shortcut.
Scenario
Users require a custom button on a NetSuite record form, such as a customer record, to provide quick access to related information or functions. This button needs to be visually integrated and, when clicked, should open a new NetSuite page or media file in a separate window.
Solution
To display a custom button on a NetSuite record form, a Formula (Text) field can be configured to embed HTML and JavaScript. While this method is functional, it is important to note that SuiteScript (User Event Scripts and Client Scripts) is the recommended and more robust approach for adding custom buttons and their associated logic in NetSuite's current interface and documentation.
Create a new custom field on the desired record type (e.g., Customer).
Set the field type to "Formula (Text)".
Enter the following formula into the field:
'<a href"/app/common/entity/custjob.nl?cfX&ftENTITY&id' || {id} ||'&eT&lT" onclick"window.open('/app/common/entity/custjob.nl?cfX&ftENTITY&id'|| {id} || '&eT&lT', 'newwindow', 'width 0,height€0, left 0'); return false;"><img src"http://shopping.sandbox.netsuite.com/core/media/media.nl?idB980&c@57631&h21ef537d122ffd13ea" alt"Setup Wizard" vertical-align: sub;style"width:120px;height:38.4px;margin:0px 0px"></a>'Expert NetSuite Support
Need help with this NetSuite issue?
Custom Fields, Records & Forms consulting and configuration support
