How To Overcome Script Execution Time Exceeded Error in Schedule script 2.0?
Category : SuiteScript 2.0
Example code:
var startTime = new Date().getTime();
for(var i=0;i<search.length;i++)
{
var endTime = new Date().getTime();
var timeElapsed = (endTime*0.001) – (startTime*0.001);
if (timeElapsed > 3300)// more than 55 mins
{
var scheduledScriptTask = task.create({
taskType: task.TaskType.SCHEDULED_SCRIPT, scriptId: runtime.getCurrentScript().id,
params: {custscript_resume_point: internalid}
});
}
//logic to process records
}
Feel free to reach out TheSmilingCoders for proper netsuite implementation, netsuite consultation , netsuite customization, netsuite Support,netsuite Trainingcontact us at:
Email : [email protected]
Linkedin : https://www.linkedin.com/company/netsuite-academy/