Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Please note that on Saturday, April 11, 2026, at 8:00 PM Pacific time, our Case Management System will undergo a scheduled maintenance for approximately 30 minutes. During this time, case creation via SuiteAnswers will be unavailable and inbound calls will be routed to Customer Service.
Suitelet - add lines to a sublist on field change
I have a requirement to add lines to a suitelet sublist on field change.
To some reason, it is not working. I tried using nlapiInsertLineItem and nlapiSelectNewLineItem with no luck. I am able to set a text field successfully but the sublist field value is not getting set.
What am I doing wrong here?
if(name == 'custpage_ad1'){ var lineCount = nlapiGetLineItemCount('custpage_orderlist'); alert('lineCount :' + lineCount); nlapiSetFieldValue('custpage_blank_space', 'sss'); nlapiSetLineItemValue('custpage_orderlist', 'custpage_orderdate',1, "bbb"); /* nlapiInsertLineItem('custpage_orderlist', 1); nlapiSetLineItemValue('custpage_orderlist', 'custpage_orderdate', "1", "1"); nlapiCommitLineItem('custpage_orderlist'); */ /* nlapiSelectNewLineItem('custpage_orderlist'); nlapiSetCurrentLineItemValue( 'custpage_orderlist', 'custpage_orderdate', "sss"); nlapiCommitLineItem('custpage_orderlist'); */ nlapiSelectNewLineItem('custpage_orderlist'); nlapiInsertLineItem('custpage_orderlist', lineCount + 1); nlapiSetCurrentLineItemValue('custpage_orderlist', 'custpage_orderdate', '87879'); nlapiCommitLineItem('custpage_orderlist'); return true; } 0