Reputation: 171
Is there any way to get list of all the Transaction's Saved Search that I have created on NetSuite using Suite Script 2.0. Please see attached screen shot.
Thanks in advance.
Upvotes: 1
Views: 2959
Reputation: 5231
Yes, you can create a search of saved searches. You can run the following in your browser console to test, and modify to suit what you need:
require(['N/search'], function (search) {
var savedSearches = search.create({
type: search.Type.SAVED_SEARCH,
filters: [
['recordtype','is','Transaction']
],
columns: [
search.createColumn({
name: 'id'
}),
search.createColumn({
name: 'title'
}),
search.createColumn({
name: 'recordtype'
})
]
});
savedSearches.run().each(
function(r) {
var a = r.getValue({
name:'id'
});
var b = r.getValue({
name:'title'
});
var c = r.getValue({
name:'recordtype'
});
console.log(a + ' | ' + b + ' | ' + c);
return true;
}
);
});
Upvotes: 2