SuiteScript 2.x: Suitelet > Select field that sources the options from a saved search

In a suitelet, there is a method called formField.addSelectOption that allows you to set the static select options for the select field. This is demonstrated by the sample code snippet below: formField.addSelectOption({ value: '1', text: 'Location A' }); formField.addSelectOption({ value: '2', text: 'Location B' }); formField.addSelectOption({ value: '3', text: 'Location C' }); formField.addSelectOption({ value: '4',…

SuiteScript 2.0: Attaching Files to Records and Emails via Scripting

Attaching files programmatically is made hassle-free through SuiteScript. You can choose to attach single or multiple file types to several kinds of NetSuite records. You can attach it directly to a record or through emails. As of this writing, attaching emails via SuiteScript is supported via these record types: TRANSACTIONS Check, Custom Transaction, Expense Report,…

SuiteScript 2.0: Suitelet Sample for Displaying Transactions in a List

Customized lists - how do you achieve it through NetSuite SuiteScript? Do you want to show a custom list in your NetSuite account, however you are running into the limitation of Saved Searches? This can be achieved through a type of SuiteScript called "Suitelet". With Suitelets, you can display a simple list of your desired…

SuiteScript 2.0: Suitelet Sample Code for Filtering a Dropdown Field

How do you filter the values of a dropdown field in NetSuite SuiteScript? To do this in NetSuite, you would need two types of script. First is by deploying the Suitelet Script itself. Suitelet Script In the suitelet, notice that we used the SuiteScript 2.0 API form.addField twice since we are adding two fields. Notice…

NetSuite Workflow Action Script: Create and redirect to a record

In NetSuite workflows, it is possible to create and redirect to a record.  However, there are some limitations to consider. For example, you cannot create a transaction via Workflow Manager. Another use case is the ability to create a Custom Record with parent-child relationships. The good news is that, these limitations are addressed by SuiteScript,…