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.
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