Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
SSS_TIME_LIMIT_EXCEEDED - 3600 seconds
We import a few thousand records of a custom record type each day. Once these records are in our system a scheduled script processes them and categorizes them by selecting an option from list/record field on the record.
I have 4 SSS_TIME_LIMIT_EXCEEDED errors from last night. The script used between 4000-6000 units. Each error says the script ran for 3600 seconds.
Here is my code:
function scheduledMEUpdate(){ var context = nlapiGetContext(); var searchAgain = true; while(context.getRemainingUsage()>15 && searchAgain){ var MEs = getMEs(); //10 var MEsLen = (MEs != null)?MEs.length:0; if(MEsLen < 1000) searchAgain = false;//search returns 1000 results... so needs to be triggered multiple times //update each record: for(var i=0;i<MEsLen && context.getRemainingUsage()>4;i++){ //if the ME has a GROUP then use GROUP join to get info else USE Item join to get info var id = MEs[i].getId(); var cols = MEs[i].getAllColumns(); var adPl = MEs[i].getValue(cols[2]); var itPl = MEs[i].getValue(cols[4]); if(adPl == ''){ if(itPl != ''){ nlapiSubmitField('customrecord_mexp',id,'custrecord_mexp_prod_line2',itPl);//4 //nlapiLogExecution('audit','INFO ','ME: '+id+' | Item PL: '+itPl); } }else{ nlapiSubmitField('customrecord_mexp',id,'custrecord_mexp_prod_line2',adPl);//4 0