tiger
10/06/2025, 6:36 AMCeligo AI
10/06/2025, 6:36 AMAI generated answer (using internal Slack threads):The scheduled script time limit in NetSuite is indeed 3600 seconds (or 60 minutes). However, this limit is not a hard stop. It's more of a guideline for when the script should yield control back to the system. If your script is running for slightly more than 3600 seconds, it could be due to a few reasons: 1. Processing Time: The script might be in the middle of a process when it hits the 3600-second mark, and NetSuite allows it to finish that process before stopping it. This could push the total execution time slightly over the limit. 2. Yielding: If your script is designed to yield control back to the system periodically (for example, after processing a certain number of records), it might be allowed to run for longer than 3600 seconds in total. Each time it yields, it gets a new "slice" of time to run. 3. System Load: The actual time a script is allowed to run can also depend on the overall load on the NetSuite servers at the time. If the servers are not busy, they might allow scripts to run for slightly longer. To handle time limit exceeded in scheduled scripts, you can have your script periodically check for elapsed time and exit or reschedule before time is up. There are APIs available to check the time. For example, you can use the
runtime.getCurrentScript().getRemainingUsage()
function to check how much script governance units are left. If the remaining units are below a certain threshold, you can have your script stop or reschedule itself.
Here's a simple example of how you might do this:
javascript
var remaining = runtime.getCurrentScript().getRemainingUsage();
if (remaining < 100) {
// Reschedule script or exit
}
Remember, this is just a simple example. Depending on your script and what it's doing, you might need to implement more complex logic to handle time limit exceeded errors.
******
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/06/2025, 6:36 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.834716797
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.831543
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.827514648
Celigo AI
10/06/2025, 6:36 AM