Hi, Is there any API in Netsuite to export data fr...
# suitescript
t
Hi, Is there any API in Netsuite to export data from the saved search?
t
when you run your saved search, there is already an excel icon located at the upper left
t
I am Taking about suite script code that load saved seach
p
It's trivial to extract the results of a saved search into the file cabinet using
N/task
. There's an example in the documentation
Something like this:
var searchTask = task.create({ taskType: task.TaskType.SEARCH});
searchTask.savedSearchId = 123; // CHANGE THIS
searchTask.filePath = ; // set this to where you want your CSV
var result = searchTask.submit();
t
Hi @PNJ Thanks.. Once more thing .. How can I use the additional filter in Saved SearchId defined in Searchtask.savedSearchId
b
not a parameter available to you
make a new search which has the filter you need
t
@battk can I use additional filters in the existing search using suite script
b
go through the parameters of task.create and task.SearchTask to see your available options
dont expect parameters that arent listed to work
a
I don't know if this will help you out at all but there's a great chrome extension that allows you to create a saved search and then export the code that would recreate the search in SuiteScript. I use it all the time. https://chrome.google.com/webstore/detail/netsuite-search-export/gglbgdfbkaelbjpjkiepdmfaihdokglp?hl=en-US