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.
Scripted Search return Terms (Accounting List)
Hi,
I am trying to search for all "Open" invoices including the Terms that has been specified. But null is returned for every row. I created a saved search through the GUI and Terms is populated. Can anyone tell me where I am going wrong? Is it a join problem?
Here is my code:
var arrFilters = [ new nlobjSearchFilter('mainline', null, 'is', 'T' ), new nlobjSearchFilter('status', null, 'anyof', 'CustInvc:A'), ]; //new nlobjSearchFilter('terms', null, 'anyof',1), //remove because returning null var arrColumns = [ new nlobjSearchColumn('internalid'), new nlobjSearchColumn('amountremaining'), new nlobjSearchColumn('duedate'), new nlobjSearchColumn('entity'), new nlobjSearchColumn('status'), new nlobjSearchColumn('terms'), new nlobjSearchColumn('custbody_cust_no') ] arrColumns[5]= arrColumns[0].setSort(); //sort by internal var arrInvoiceResults = nlapiSearchRecord('transaction', null, arrFilters, arrColumns); var arrInvoices = []; for(var i=0; arrInvoiceResults!=null && i<arrInvoiceResults.length;i++){ var stAmountRemaining = arrInvoiceResults[i].getValue('amountremaining'); var stDueDate = arrInvoiceResults[i].getValue('duedate'); var stEntity = arrInvoiceResults[i].getValue('entity'); var stStatus = arrInvoiceResults[i].getValue('status'); var stBlueNum = arrInvoiceResults[i].getValue('custbody_cust_no'); var stTerms = arrInvoiceResults[i].getValue('terms'); logger.debug(stLoggerName, 'Invoice ID: ' +arrInvoiceResults[i].getId()+ ' | Customer: ' + stEntity 0