michoel
07/16/2019, 11:53 PMfunction getCustomerQuotations(customerId) {
const results = [];
search
.create({
type: search.Type.ESTIMATE,
filters: [
['name', search.Operator.ANYOF, customerId],
'AND',
['mainline', <http://search.Operator.IS|search.Operator.IS>, 'T'],
'AND',
['trandate', search.Operator.ONORAFTER, 'monthsago12'],
],
columns: [
'tranid',
'amount',
'memo',
'otherrefnum',
search.createColumn({ name: 'trandate', sort: search.Sort.DESC }),
],
})
.run()
.each(function(result) {
results.push({
id: result.id,
transactionId: result.getValue({ name: 'tranid' }),
date: result.getValue({ name: 'trandate' }),
amount: result.getValue({ name: 'amount' }),
memo: result.getValue({ name: 'memo' }),
customerOrderNumber: result.getValue({ name: 'otherrefnum' }),
});
return true;
});
return results;
}