Modules

filter

 

Objects/Functions

module (N/task)

SuiteScript 2.0

task.SearchTask

// Please search https://system.netsuite.com/app/help/helpcenter.nl?search=task.SearchTask for more information.

N/task Module
task.SearchTask
Object Description: The properties of a search task. Use the methods and properties for this object to submit a search task into the task queue, execute it asynchronously, and persist search results. Similar to SuiteAnalytics persisted search functionality, this capability is useful for searches across high volumes of data. You can create a task.SearchTask object using task.create(options). Use the task.SearchTask object to do the following: Set the search ID using the SearchTask.savedSearchId property. Set the file ID or file path of a CSV file in the File Cabinet. Search results are exported to this file. Use the SearchTask.fileId property or the SearchTask.filePath property. Exactly one of these properties must be set. If both are set, an error occurs. Add dependent scripts to the search task using SearchTask.addInboundDependency(). Dependent scripts are processed automatically when the search task is complete. Submit the search task to the NetSuite task queue using SearchTask.submit(). Get the status of a search task using the properties of the task.SearchTaskStatus object. There is a limit to the number of asynchronous searches running at the same time. The limit is set to be the same as the limit for CSV import. The file size limit is based on File Cabinet limits.
Supported Script Types: Server scripts For more information, see SuiteScript 2.0 Script Types.
Module: N/task Module
Since: 2017.1
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=task.SearchTask

Example:

// Code Example 1
//Add additional code
//...
var searchTask = task.create({
taskType: task.TaskType.SEARCH
});
searchTask.savedSearchId = 51;

var path = 'ExportFolder/export.csv';
searchTask.filePath = path;

var searchTaskId = searchTask.submit();
//...
//Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4799343953.html