How to access sublist data in a suitelet

Suitelets allow us to create custom pages within NetSuite. One of the common
implementations for a suitelet is getting data from a user and then processing the data
for display. To get and process the fields that are created in the suitelet, we use
server request.parameters to access the values of the fields. A sublist can also be
created in a suitelet. If we want to access the data that were entered in the sublist, how
do we do it?

SuiteScript 2.x have 2 methods for that purpose –
ServerRequest.getLineCount(options) and
server request.getSublistValue(options). The former returns the total number of lines
in a sublist while the latter returns the value of a specific sublist line item.

The sample below shows the use of the 2 methods:

Leave a comment

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