dennysutanto
08/15/2024, 1:59 PMconst orSearch = search.load({ id: 'customsearch_ps_emptybrand' });
const inputData = [];
let rows = orSearch.run().getRange(0, 1);
log.debug('rows', rows);
for (let i in rows) {
const internalid = rows[i].getValue({ name: 'internalid', summary: 'GROUP' });
inputData.push({ internalid });
}
log.debug('inputData', inputData);
return inputData;
If i run the saved search from Netsuite UI, i can see 15 results, but in the map reduce above,
rows
and inputData
are showing empty array
I can confirm that the saved search that i'm using in the script and the one i run in UI is the same. Any idea what am i missing here ?erictgrubaugh
08/15/2024, 3:43 PMfor..in
is not advised for iterating over Arrays. for..of
, forEach
, and other iterators like map
are preferred.dennysutanto
08/15/2024, 3:50 PMdennysutanto
08/15/2024, 3:50 PMdennysutanto
08/15/2024, 3:51 PMerictgrubaugh
08/15/2024, 3:52 PMdennysutanto
08/15/2024, 3:52 PMdennysutanto
08/15/2024, 3:52 PMerictgrubaugh
08/15/2024, 3:52 PMerictgrubaugh
08/15/2024, 3:52 PMdennysutanto
08/15/2024, 3:52 PMdennysutanto
08/15/2024, 3:53 PMdennysutanto
08/15/2024, 3:56 PMdennysutanto
08/15/2024, 3:59 PMdennysutanto
08/15/2024, 4:00 PMdennysutanto
08/15/2024, 4:01 PMehcanadian
08/15/2024, 4:18 PMerictgrubaugh
08/15/2024, 4:34 PMsummarize
. A try..catch
like Lee suggests might help you surface the errordennysutanto
08/15/2024, 4:46 PMdennysutanto
08/15/2024, 4:46 PMdennysutanto
08/15/2024, 4:47 PMKody Brand
08/16/2024, 4:16 PMfunction getInputData() {
const search = nsSearch.load({
id:'customsearch_ps_emptybrand'
});
return search;
}
Shawn Talbert
08/16/2024, 5:53 PMerictgrubaugh
08/16/2024, 5:54 PMShawn Talbert
08/16/2024, 5:55 PMShawn Talbert
08/16/2024, 5:55 PMerictgrubaugh
08/16/2024, 5:57 PMerictgrubaugh
08/16/2024, 5:57 PMFred Pope
08/16/2024, 9:01 PMdennysutanto
08/17/2024, 2:20 PM