RE: How to modify a SuiteLet sublist via linked Client Script?

Hi there, I have a SuiteLet with an empty sublist. A button on the SuiteLet directs to a Client Script which is attempting to populate the sublist. I’m encountering a strange error on my Client Script—”undefined is not an object (evaluating ‘olddata[i]’).” This is a JavaScript error, I believe referring to “rec” in the following code. The error initiates on “rec.commitLine.”
function populateSublist(fieldValues, rec, availableItems) {
        log.debug("Rec", rec);
        if (availableItems[0]) {
            for (i = 0; i < availableItems.length; i++) {
                try {
                        sublistId: 'custpage_items_sublist'

                        sublistId: 'custpage_items_sublist',
                        fieldId: 'custpage_parent_frame',
                        value: availableItems[0].item_parent_frame

                    // More values being set...

                    rec.commitLine({ // <=== *** RIGHT HERE ***
                        sublistId: 'custpage_items_sublist'
                } catch (e) {
                    log.error("Unable to commit line - " +, e.message);
        } else {
            log.debug("No available items for given parameters.")


Here are some things I know:

  1. “rec” is working previously and getting field names I need.
  2. “rec” is showing “{“id”:””,”type”:null,”isDynamic”:true}” in my execution log.
  3. The beginning of my Client Script uses “var rec = currentRecord.get();” to receive the record.

Is it possible to modify a SuiteLet sublist from a Client Script? I’ve never done this in particular before, so I’m at a loss here. Any help or ideas are immensely appreciated! Thanks!

Ben_sr Rookie Asked on December 18, 2020 in SuiteScript.
Add Comment
3 Answers

We were able to resolve this issue today. This problem was due to defining the SuiteLet sublist as SublistType.LIST. NetSuite doesn’t support editing sublists defined as “LIST” outside of server-side scripts. Thus, we encountered this strange error when trying to edit it via the Client Script.

Two possible solutions are:

  1. Change SuiteList SublistType to “INLINEEDITOR.”
  2. Move sublist editing over to Server Side (SuiteLet).


Thanks! Perhaps this will help someone out in the future at least.
Rookie Answered on December 18, 2020.

Hi Ben..i am looking for the same issue..can you please share the correct suitelet and client code asap

on December 25, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.