I have a Suitelet that I am using to load an existing transaction saved search. I load the search, add a filter to get results for only one date, run the search, use the forEachResult function with an unnamed function in which I try to get a value from the current row.
function generateReport(request, response){ //get request parameters var reqDateProcessed = request.getParameter('dateProcessed'); //create filter with date from request var filters = new Array(); filters[0] = new nlobjSearchFilter('trandate', null, 'on', reqDateProcessed); //load saved search var searchResults = nlapiLoadSearch('transaction','customsearch_mycustomsearch'); //add filter searchResults.addFilters(filters); //run saved search var resultSet = searchResults.runSearch(); //iterate through result set resultSet.forEachResult(function (eachResult){ var x = eachResult.getValue('custbody_customfieldname'); return true; }); } In the debugger for eachResult it shows that the id=null, recordType=null, columns = {array} length=16 and it shows the correct set of values for each row as it iterates through the search. No matter what value I try to get from eachResult it shows up as undefined. I've tried the custom fields as well as the standard fields like 'trandate'.I can see the values in the debugger. What am I missing to be able to get those values out of eachResult?