Working with Sublists
NetSuite Records are divided into Body fields and Sublists. There are four types of sublists: Static, Editor, Inline Editor, and List.
We are able to add, insert, edit, and remove line items using Sublist APIs.
For a reference on exactly which sublists support SuiteScript, see the NetSuite Help page titled "Scriptable Sublists".
Script Type Overview
You create SuiteScript customizations using an event-driven system. You define various types of Script records, each of which has its own unique set of events, and in your source file, you define functions that will be called to handle those events as they occur.
Scripts are one of the primary components with which you'll design and build your applications. The goal with this article is merely to become acquainted with the Script types and events available.
Lookup Data from Related Records
When processing a given record, you will oft need to retrieve data from one of its related records. For example, when working with a given Sales Order, you may need to retrieve data from the related Sales Rep. In SuiteScript terminology, this is called a lookup.
Lookup functionality is provided by the
nlapiLookupField global function in SuiteScript 1.0 and the
lookupFields method in SuiteScript 2.0
Understanding Transaction Searches
A deep understanding of how Transaction searches function is crucial knowledge for every NetSuite developer, but the default behaviour of these searches, and controlling that behaviour, can be quite confusing initially.
Searches with large number of results
Suitescript 2.0 provides 4 methods to handle the search results.
They have different syntax, limitations and governance, and are appropriate for different situations. We will focus here on how to access ALL search results, using each of these methods.
Scripting searches with Filter Expressions
When you create searches with Suitescript, you could provide as "filters" either array of Filter objects, or filter expression. The second option is more readable and gives you very flexible option to provide nested expressions (up to 3 levels) using not only the default "AND", but also, "OR" and "NOT" operators.