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.
Update: Narrative Insights has been restored and is now available.
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
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