getInputData(inputContext)
Description |
Marks the beginning of the script’s execution. The purpose of the input stage is to generate the input data. Executes when the getInputData entry point is triggered. This entry point is required. For information about the context object provided to this entry point, see inputContext.
Note:
When |
Returns |
Array | Object | File | Query | Dataset | Search | object reference (file, suiteql, query, search) In simple scenarios, you can return a plain Array or a plain Object.
Often, data comes from a query. In such case, return a SuiteQL object reference.
Alternatively, you can return Query / Search objects.
If the query / search exists, simply return a Query / Search object reference. There's no need to load anything.
Another common source of data are files. Map will be called for each line of the file.
Note:
The file cannot contain empty lines. Datasets are supported as well.
|
Since |
2015.2 |
Parameters
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
Object |
Required |
Object that contains:
For a description of each property in this object, see inputContext Object Members. |
Errors
When an error is thrown in this function, the job proceeds to the summarize(summaryContext) function. The serialized error is encapsulated in the inputSummary.error property.
Syntax
The following code snippet shows the syntax for this member. It is not a functional example. For a complete script example, see Map/Reduce Script Samples.
// Add additional code
...
function getInputData {
{
// Reference a saved search that returns a list of NetSuite records that
// require processing - for example, sales orders that are pending fulfillment.
return {
type: 'search',
id: 1234
};
}
...
// Add additional code