Skip to content

Instantly share code, notes, and snippets.

@cafeasp
Created July 15, 2019 19:14
Show Gist options
  • Save cafeasp/34b5dbd4260089616eaba0ad39fa192c to your computer and use it in GitHub Desktop.
Save cafeasp/34b5dbd4260089616eaba0ad39fa192c to your computer and use it in GitHub Desktop.
NetSuite Load Save Search
function RunSaveSearch() {
var mySearch = search.load({
id: '111111'
});
var array = [];
mySearch.run().each(function (result) {
log.debug('result', result);
var netamount = result.getValue({
name: 'netamount'
});
log.debug('amount net', netamount);
var transactionnumber = result.getValue({
name: 'transactionnumber'
});
var memo = result.getValue({
name: 'memo'
});
var statusref = result.getValue({
name: 'statusref'
});
if (netamount > 0 && statusref == 'pendingFulfillment') {
//take action
} else {
//dif action
}
array.push(netamount);
var a = { net: netamount, memo: memo };
array.push(a);
//must return true
return true;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment