Aly
10/15/2024, 11:32 AMCeligo AI
10/15/2024, 11:33 AMAI generated answer (using internal Slack threads):Yes, there is a way to execute a scheduled script immediately during the testing phase. You can use the 'Save and Execute' button on the script deployment page. This will allow you to run the script on demand for testing purposes. Here is an example of a scheduled script that can be executed on demand:
javascript
/**
*@NApiVersion 2.1
*@NScriptType ScheduledScript
*/
import { EntryPoints } from "N/types";
import log from "N/log";
async function execute(context: EntryPoints.Scheduled.executeContext) {
if (context.type !== context.InvocationType.ON_DEMAND) return;
try {
log.debug("Hello World", "I'm an on demand scheduled script");
} catch (e) {
log.error("Error", e);
}
return "Hello World";
}
export = {
execute,
};
However, please note that if the script gets queued behind any other scheduled script currently running, it will not execute right away. You cannot interrupt scripts that are currently running in the queue. If you are using SuiteCloud Plus, you can reserve a processor for high priority jobs and only run your scheduled script high priority.
******
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/15/2024, 11:33 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.839652717
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.837907374
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.829518676
Celigo AI
10/15/2024, 11:33 AM