Luis
10/08/2024, 8:42 PMCeligo AI
10/08/2024, 8:43 PMAI generated answer (using internal Slack threads):To call a second script from a beforeSubmit function, you can use the task module in NetSuite SuiteScript. The second script should be a Scheduled Script or Map/Reduce script because User Event scripts and Client scripts cannot be scheduled. Here's a basic example of how you can create a task for a Scheduled Script:
javascript
var scriptTask = task.create({taskType: task.TaskType.SCHEDULED_SCRIPT});
scriptTask.scriptId = 'customscript_my_scheduled_script';
scriptTask.deploymentId = 'customdeploy_my_scheduled_script';
var scriptTaskId = scriptTask.submit();
To pass parameters to the second script, you can use the params
property of the task object:
javascript
scriptTask.params = {
custscript_my_param: 'my value'
};
In the second script, you can access these parameters using the runtime
module:
javascript
var scriptParam = runtime.getCurrentScript().getParameter({name: 'custscript_my_param'});
Remember that the parameter name should be prefixed with 'custscript_' and the parameter should be defined in the script record in NetSuite.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
10/08/2024, 8:43 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.845196664
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.831317782
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.826449394
Celigo AI
10/08/2024, 8:43 PM