SuiteScript Samples Catalog Complete Listing

The following table lists all samples available in the SuiteScript Sample Catalog. Links for each sample are included that go to the first occurrence of the sample in the catalog. The table lists each category in the catalog that includes each sample. For instance, the Access Parameterized Translation Strings sample is included in the Samples by Function > Translation and Samples by Module > N/translation categories.

Samples can also be found on the netsuite-suitecloud-samples github repository at: netsuite-suitecloud-samples.

Sample Name

SuiteScript 2.1 Samples

SuiteScript Samples by Script Type

SuiteScript Samples by Function

SuiteScript Samples by Module

SuiteScript Samples That Use Promises

Custom Plug-in Samples

SuiteScript Use Cases Samples

Access Parameterized Translation Strings

Translations

N/translation

Access Sublists and a Subrecord from a Record

Lists, Sublists, and Subrecords

N/record

Uses Promises

Access Sublists and a Subrecord from a Record Asynchronously Using Promise Methods

Lists, Sublists, and Subrecords

N/record

Uses Promises

Access Translation Strings

Translations

N/translation

Access Translation Strings Using a Non-Default Locale

Translations

N/translation

Add a Custom Button to Execute a Suitelet

2.1 Sample

Suitelet Script

User Event Script

Use Case Sample

Add a Dynamic Link to a List in a Suitelet

Suitelet Script

Lists, Sublists, and Subrecords

Add a Field that Displays Running Total to a Sublist

Suitelet Script

Lists, Sublists, and Subrecords

Add a Secret Key Field to a Form

Suitelet Script

Secret Keys

N/keyControl

Add a Suitelet to a Tab

Suitelet Script

User Event Script

UI Customizations

Calculate Commission on a Sales Order

2.1 Sample

User Event Script

Sales Orders

Use Case Sample

Call a Macro on a Sales Order Record

Sales Orders

N/record

Change a NetSuite Email Address and Password

Email

User Credentials, Authentication,and Access

N/auth

Compress and Decompress a File

Files

N/compress

Concatenate API Secrets with Strings

N/https

Convert a Query to SuiteQL and Run It

Queries

N/query

Convert a String to a Different Encoding

Formatting, Parsing, and Encoding

N/encode

Copy a Value to the Item Column

2.1 Sample

Client Script

Use Case Sample

Create a Comprehensive Workbook

Workbooks and Datasets

N/workbook

Create a Confirmation Dialog

2.1 Sample

UI Customizations

N/ui/dialog

Create a Custom Assistant Script

Suitelet Script

UI Customizations

Create a Custom Error

Logging and Errors

N/error

Create a Custom Form with a Submit Button, Fields, and an Inline Editor Sublist

2.1 Sample

Suitelet Script

Forms

Lists, Sublists, and Subrecords

N/ui/serverWidget

Create a Custom List

Suitelet Script

UI Customizations

Create a Custom Plug-in for Inbound E-Document Validation

E-Documents

Create a Custom Plug-in for Implementation for E-Document Custom Data Source

E-Documents

Plug-in Sample

Create a Custom Plug-in Implementation for Sending E-Documents

E-Documents

Plug-in Sample

Create a Custom Survey Form

Suitelet Script

Forms

Surveys

N/ui/serverWidget

Create a Dataset, Run the Dataset, and List All Existing Datasets

Workbooks and Datasets

N/dataset

Create a Dialog that Includes a Default Button

2.1 Sample

UI Customizations

N/ui/dialog

Create a Dialog with Buttons

2.1 Sample

UI Customizations

N/ui/dialog

Create a Digital Signature Plug-in Implementation for E-Documents

E-Documents

Plug-in Sample

Create a File, Set Property Values, and Save It to the File Cabinet

2.1 Sample

Files

N/file

Create a Form Containing Several Field Types, Reset and Submit Buttons, Tabs, and a Sublist

Suitelet Script

Forms

UI Customizations

Create a Form Portlet with a Button That Allows User Adjustments

Forms

UI Customizations

N/portlet

Create a Form with a Field that Generates a GUID

2.1 Sample

Suitelet Script

Forms

UI Customizations

User Credentials, Authentication,and Access

N/https

Create a JWT Token Using a Secure String

N/https

Plug-in Sample

Create a Quality Custom Inspection Rule Plug-in

Plug-in Sample

Create a Query for a Custom Field

Queries

N/query

Create a Query for Customer Records and Run It as a Non-Paged Query

2.1 Sample

Customer Records

Queries

N/query

Create a Query for Transaction Records and Run It as a Paged Query

2.1 Sample

Queries

N/query

Create a Query Using a Specific Record Field

Queries

N/query

Create a Script for Sending E-Documents

E-Documents

Plug-in Sample

Create a Search for a Custom Record Type

Searches

N/search

Create a Secure Key Using SHA512

2.1 Sample

Secret Keys

N/crypto

Create a Secret Key

Secret Keys

N/keyControl

Create a Suitelet to Request User Credentials, Create a Secret Key, and Encode a Sample String

Secret Keys

User Credentials, Authentication,and Access

N/crypto

Create a URL and Send a Secure HTTPS POST Request to the URL

HTTP/HTTPS and SFTP

URLs

N/url

Create a ZIP File

Files

N/compress

Create an Alert Dialog

2.1 Sample

UI Customizations

N/ui/dialog

Create an Authentication Header Using a Secure String

N/https

Create an Error Based on a Condition

Logging and Errors

N/error

Create and Save a Contact Record

2.1 Sample

Contacts

N/record

Create and Save a Contact Record Asynchronously Using Promise Methods

2.1 Sample

Contacts

N/record

Uses Promises

Create and Save a CSV File then Reload the File and Parse Its Contents

Files

Formatting, Parsing, and Encoding

N/file

Create and Save a File to the File Cabinet

2.1 Sample

Files

N/file

Create and Save Certificate Record Based on a File in the File Cabinet; Load, Edit, and Save the New Certificate Record

Certificates

Create and Submit a Map/Reduce Script Task

2.1 Sample

Tasks

N/task

Create and Submit a Task with Dependent Scripts

Map/Reduce Script

Scheduled Script

Searches

Tasks

N/task

Create and Submit an Asynchronous Search Task and Export the Results into a CSV File

2.1 Sample

Searches

Tasks

N/task

Create Confirmation, Information, and Error Messages

2.1 Sample

UI Customizations

N/ui/message

Create Datasets, Dataset Links, and a Workbook with a Pivot and Run the Workbook

N/workbook

Uses Promises

Create Debug Log Messages

Logging and Errors

N/log

Create, Modify, and Save Certificate Record Based on a File in the File Cabinet

Certificates

Files

N/certficateControl

Create Multiple Sales Records Using a Scheduled Script

Scheduled Script

Sales Orders

N/runtime

N/record

Create Signer and Verifier Objects

2.1 Sample

Certificates

N/crypto/certificate

Delete a Saved Search

Searches

N/search

Establish an SFTP Connection Using an SSH Key; Create, Update, Load, and Delete a Certificate Record

Certificates

HTTP/HTTPS and SFTP

N/certficateControl

Execute a Bulk Action on a Timebill Record

Timebill Records

N/action

Filter the Digital Certificate List by Subsidiary and File Type

Certificates

N/certficateControl

Find Actions Available for the Timebill Record Asynchronously Using Promise Methods

Client Script

Timebill Records

N/action

Uses Promises

Find and Use an Existing Certificate Record

Certificates

N/certficateControl

Find Plug-in Implementations

Suitelet

N/plugin

Find the Audit Trail of POST Operations for a Certificate Record Based on ID

Certificates

N/certficateControl

Format 12345 as a German String

Formatting, Parsing, and Encoding

Translations

N/format/i18n

Format a Number as a String

Formatting, Parsing, and Encoding

N/format

Format a Number as a String Using N/format/i18n

Formatting, Parsing, and Encoding

N/format/i18n

Format Currency Based on the Locale Parameter

Currency

Formatting, Parsing, and Encoding

N/format/i18n

Format Numbers and Currencies Based on the English-India Locale Parameter

Currency

Formatting, Parsing, and Encoding

N/format/i18n

Format Numbers as Currency Strings

Currency

Formatting, Parsing, and Encoding

N/format/i18n

Format Currency Based on the Locale Parameter

Formatting, Parsing, and Encoding

N/format/i18n

Format Time of Day as a String

Dates and Times

Formatting, Parsing, and Encoding

N/format

Generate a New OAuth Token for a User

User Credentials, Authentication,and Access

N/sso

Generate a PDF from a Raw XML String

Files

XML

N/render

Generate a Secure Token and a Secret Key

2.1 Sample

Secret Keys

N/https

Generate a Signature of a Plain Text String and Verify the Signature Using the Same Certificate

Certificates

N/certficateControl

Generate a suiteSignOn Token in a Portlet

Portlet Script

User Credentials, Authentication,and Access

N/sso

Generate a suiteSignOn Token Using a Suitelet

Suitelet Script

User Credentials, Authentication,and Access

N/sso

Generate a suiteSignOn Token Using a User Event Script

User Event Script

User Credentials, Authentication,and Access

N/sso

Generate an Absolute URL to a Specific Resource

URLs

N/url

Get the Localization Context of an Employee Record

Localization

N/recordContext

List All Datasets and Load the First Dataset

Workbooks and Datasets

N/dataset

Load a Search for Sales Order Records and Return the First 100 Search Results

Sales Orders

Searches

N/search

Load a Search for Sales Order Records and Use a Callback Function to Process Results

Sales Orders

Searches

N/search

Load an XML File and Obtain Child Element Values

Suitelet Script

Files

XML

N/xml

Load an XML File from the File Cabinet and Sign It using a Digital Certificate

2.1 Sample

Certificates

Files

XML

M/crypto/certificate

Load and Run a Paginated Search and Process the Results

Searches

N/search

Load the Company Information Configuration Page and Set Field Values

Configuration

N/config

Locate and Execute an Action on a Timebill Record

Timebill Record

N/action

Load Specific Translation Strings from a Collection

Translations

N/translation

Load Translation Strings by Key from a Translation Collection with Multiple Locales

Translations

N/translation

Load Translation Strings by Key from Multiple Translation Collections

Translations

N/translation

Look Up Folder IDs

N/cache

Manage Files and Directories

2.1 Sample

Files

HTTP/HTTPS and SFTP

N/sftp

Merge Revenue Arrangements Using a Saved Search

Revenue Records

Searches

Tasks

N/task/accounting/recognition

Merge Revenue Arrangements Using an Ad-Hoc Search

Revenue Records

Searches

Tasks

N/task/accounting/recognition

Merge Revenue Elements Using Internal IDs

Revenue Records

Tasks

N/task/accounting/recognition

Obtain the Exchange Rate Between the Canadian Dollar and the U.S. Dollar

Parse a Czechia Phone Number

N/format/i18n

Parse a String to a Date Object

Suitelet Script

Dates and Times

Formatting, Parsing, and Encoding

N/format

Parse a String to a Number

Formatting, Parsing, and Encoding

N/format

Parse a U.S. Phone Number

Formatting, Parsing, and Encoding

N/format/i18n

Parse an XML File and Append New Elements

Parse an XML String and Log Element Values

Suitelet Script

Files

Formatting, Parsing, and Encoding

Logging and Errors

XML

N/xml

Perform Field Sourcing Synchronously

Basic Record Operations

N/currentRecord

Read and Log File Contents Using Commas and New Lines as Separators

Files

Logging and Errors

N/file

Read and Log Segments from a File Using a Set of Characters as Separators

Files

Logging and Errors

N/file

Redirect a New Sales Order and Set the Entity Field

Suitelet Script

Basic Record Operations

Sales Orders

N/http

Remove Phone Numbers and Comments from Customer Records

Customer Records

N/piremoval

Render a PDF

Suitelet Script

Files

N/render

Render a Transaction Record Into an HTML Page

Transactions

N/render

Render an Invoice Into a PDF Using an XML Template

Files

Transactions

XML

N/render

N/xml

Render Search Results Into a PDF

Suitelet Script

Files

Searches

N/render

Request a URL using http.get

2.1 Sample

URLs

N/http

Retrieve Information for a SuiteApp

N/suiteAppInfo

Retrieve Name of a City Based on a ZIP Code Using Cache and a Custom Loader Function

2.1 Sample

Suitelet Script

N/cache

Retrieve the Domain for Calling a RESTlet

N/url

Retrieve the Relative URL of a Record

URLs

N/url

Retrieve Website and Item Data

N/commerce/recordView

Return a Simple XML Document

Suitelet Script

Files

XML

Return a File with Alternative Character Encoding

Suitelet Script

Files

Return User and Session Information

Suitelet Script

User and Session Information

N/runtime

Run an Arbitrary SuiteQL Query

Queries

N/query

Sample Scheduled Script

Scheduled Script

Search for and Execute a Workflow Deployed on the Customer Record

Customer Records

Searches

Workflows

N/workflow

Search for Customer Records and Log First 50 Results

Customer Records

Searches

N/search

Search for Items in a Custom List

Searches

N/search

Search for Sales Order Records

Searches

N/search

Send a Secure Post Request to a Remote URL

2.1 Sample

URLs

N/https/clientCertificate

Send an Email with an Attachment

2.1 Sample

Email

N/email

Set a Default Posting Period in a Custom Field

2.1 Sample

Client Script

Set a Redirect URL to a Newly Created Task Record

Tasks

URLs

N/redirect

Set Conditional Default Settings Using N/sftp Enums

User Event Script

Files

HTTP/HTTPS and SFTP

N/sftp

Set Fields on a Sales Order Record Using util.each (Iterator)

Sales Orders

N/util

Set the Purchase Order Exchange Rate

2.1 Sample

Client Script

Currency

Submit a Record Action Task and Check Status

Tasks

N/task

Track Deposits and Refunds

2.1 Sample

User Event Script

Transactions

Update E-Document Certification Statuses

E-Documents

Plug-in Sample

Update Fields on Current Record using a Custom Module Script and a User Event Script

2.1 Sample

Basic Record Operations

N/currentRecord

Upload and Download a File

2.1 Sample

Files

N/sftp

Use a Custom Module Client Script

2.1 Sample

User Event Script

N/currentRecord

Void a Sales Order Transaction

Sales Orders

Transactions

N/transaction

Write and Send Email

Suitelet Script

Email

Forms

Write Your First Suitelet

Suitelet Script

General Notices