I am looking to find out how to get the values columns that exist in an array. My my end goal is to iterate through all saved searches in NetSuite and dump the column values into a custom record that I can then search for values within. (getting rid of a custom record and wondering if any saved searches rely on the custom record)
I am able to only get so far, the values that are written back to the custom record appear as "[object Object],[object Object]"... How do I extract the "name" value for each object in the array, for example?
In the console, I can simply branch out the tree to do this, so I'm hoping there is an easier way to do so within Javascript. mySearch.getColumns().getValueOf("Name")...something like that.
var filters = new Array(); filters.push(new nlobjSearchFilter('custrecord_ss_filters', null, 'isempty')); var columns = new Array(); columns.push(new nlobjSearchColumn('custrecord_ss_type')); columns.push(new nlobjSearchColumn('custrecord_ss_id')); columns.push(new nlobjSearchColumn('internalid')); var searchResults = nlapiSearchRecord('customrecord484', null, filters, columns); console.log(searchResults.length + ' records.'); for (var i=0; i < searchResults.length; i++) { var mySearch = nlapiLoadSearch(searchResults[i].getValue('custrecord_ss_type'), searchResults[i].getValue('custrecord_ss_id')); nlapiSubmitField('customrecord484', searchResults[i].getValue('internalid'), 'custrecord_ss_filters', mySearch.getFilters()); // THIS IS WRITING BACK "[object Object],[object Object]", and I'm looking to get the value of "name" within each object }