Modules
Objects/Functions
SuiteScript 2.0
// Please search https://system.netsuite.com/app/help/helpcenter.nl?search=ResultSet.each.promise(callback) for more information.
N/search Module
ResultSet.each.promise(callback)
Method Description:
Asynchronously uses a developer-defined function to invoke on each row in the search results, up to 4000 results at a time. The callback function must use the following signature:
boolean callback(result.Result result);
The parameters and errors thrown for this method are the same as those for ResultSet.each(callback). For more information on promises, see Promise Object.
Returns:
Promise Object
Supported Script Types:
All client-side scripts
For more information, see SuiteScript 2.0 Client Script Type.
Governance:
10 units
Module:
N/search Module
Since:
2015.2
Search NetSuite -
https://system.netsuite.com/app/help/helpcenter.nl?search=ResultSet.each.promise(callback)
Example:
// Code Example 1
//Add additional code
//...
mySearch.run().each.promise(function(result) {
var entity = result.getValue({
name: 'entity'
});
var subsidiary = result.getValue({
name: 'subsidiary'
});
return true;
})
.then(function(response){
log.debug({
title: 'Completed',
details: response
});
})
.catch(function onRejected(reason) {
log.debug({
title: 'Failed: ',
details: reason
});
})
//...
//Add additional code
//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4629990761.html