I'm new to saved searches but I'm trying to do som...
# suitescript
s
I'm new to saved searches but I'm trying to do something that I think is pretty straightforward, however its not working. Can anyone point to what I'm doing wrong? My goal is to load a saved search, and pull all the results as an array of all the rows (first row being the column labels as headers). I can get the columns/labels using
resultSet.columns
but how do I iterate through the results themselves and access each column's data? I have tried the following:
Copy code
rows = [];
resultSet.each(function (result) {
        row = [];
        result.columns.forEach(function (col) {
        	row.push(result.getValue({name: col.label}));
        });
        rows.push(row);
});
But I only get null. So I can't access the columns by their labels? But I have some formulas so it's not like I can access the columns using names either because the names are just "formulatext"... so what am I doing wrong?