AnsweredAssumed Answered

Failed to execute script

Question asked by irene08 on Oct 8, 2012
Latest reply on Oct 8, 2012 by irene08
Hi! Good Day!

Does anyone knows how to debug this error? Please. Thanks. I got that error in javascript console.

500 Internal Error An error inside the HTTP server which prevented it from fulfilling the request. 09080024 Wrapped Exception (with status template): 09080139 Failed to execute script 'Javascript Console Script': 09080138 TypeError: Cannot read property "1.0" from null (95f636652537d5a2f2efff620411b081.js#16)
___________________________________________________________________________________________________________________
Here is my script.

//Tag category to Approval

    var categoryToAdd = null;
   var categories = classification.getRootCategories("cm:generalclassifiable");
   var remainingNames = ["Document Review Status", "Approval"];
   
   while(categoryToAdd == null && categories && remainingNames.length > 0)
    { 
      var idx = 1, max = categories.length, innerCategories = categories;
     
      // reset categories to prevent further iterations if we don't find a match
      categories = null;
      
      for(;idx < max; idx++)
      {
      var category = categories[idx];
   
          if (wf_actualPercent = 100)
            {
            categories = categories.getSubCategories();
            remainingNames.shift();
            break;
            }
        }
          if(categoryToAdd != null)
            {
         var oldCategories = document.properties["cm:categories"];
         var newCategories = oldCategories != null ? oldCategories : [];
         newCategories.push(categoryToAdd);
         document.properties["cm:categories"] = newCategories;
         document.save();
            }
    }
_______________________________________________________________________________________________________________________

Thank you,
Irene

Outcomes