Example of a RESTlet that Manipulates Scheduled Script
The following RESTlet passes a value to a scheduled script.
Note:
The scriptId and deploymentId in this sample are placeholders. Before using this script, replace the IDs with valid values from your NetSuite account.
/**
* @NApiVersion 2.x
* @NScriptType Restlet
*/
define(['N/task'], function(task) {
return {
get : function() {
var mrTask = task.create({
taskType: task.TaskType.SCHEDULED_SCRIPT
});
mrTask.scriptId = 488;
mrTask.deploymentId = 'customdeploy_scheduledscript';
mrTask.params = {
custscriptcustom_data: 'data'
};
mrTask.submit();
return "Scheduled script updated";
}
}
});
Related Topics
- SuiteScript 2.x RESTlet Script and Request Examples
- Example Hello World RESTlet
- Example of a RESTlet that Retrieves, Deletes, Creates, and Upserts a NetSuite Record
- Example of a RESTlet that Adds Multiple Records
- Example of a Client Script that Calls a RESTlet
- Example of a Suitelet that Calls a RESTlet
- Example of a Shell Script that Calls a RESTlet