Contact Us
A netsuite consultant smiles while seated at a desk, working on a laptop.

The setSublistValue Error

I was receiving an error on the setSublistValue due to a missing 'options.value' parameter even though I was setting the value attribute this way:

     sublist.setSublistValue({
                       id: 'custpage_vendor',
                       line: lineNum,
                       value: result.getText('othervendor') || ''
    });
image (30).webp

NetSuite doesn't like this because an empty string evaluates to undefined and this throws the error. The clean way to do this to avoid errors is to say "or null" as such:

sublist.setSublistValue({
                       id: 'custpage_vendor',
                       line: lineNum,
                       value: result.getText('othervendor') || null
    });

Related Articles

Tagged with Troubleshooting