AnsweredAssumed Answered

category.addSubCategory

Question asked by gcoleman on Oct 8, 2007
Latest reply on Apr 19, 2010 by amarendra.thakur
Does any one know why this javascript does not work in Alfresco 2.1

16:34:15,074 DEBUG [repo.jscript.RhinoScriptProcessor] Script content resolved t
o:
var cat = search.luceneSearch("PATH:\"cm:generalclassifiable//cm:Keywords\" ")[0
];

logger.log("cat");
logger.log(cat);
logger.log("cat.isCategory");
logger.log(cat.isCategory);
logger.log("cat.name");
logger.log(cat.name);
logger.log("createSubCategory");
cat.createSubCategory("greg");

16:34:15,152 DEBUG [repo.jscript.ScriptLogger] cat
16:34:15,152 DEBUG [repo.jscript.ScriptLogger] Node Type: {http://www.alfresco.o
rg/model/content/1.0}category, Node Aspects: [{http://www.alfresco.org/model/con
tent/1.0}auditable, {http://www.alfresco.org/model/content/1.0}titled, {http://w
ww.alfresco.org/model/system/1.0}referenceable]
16:34:15,152 DEBUG [repo.jscript.ScriptLogger] cat.isCategory
16:34:15,152 DEBUG [repo.jscript.ScriptLogger] false
16:34:15,152 DEBUG [repo.jscript.ScriptLogger] cat.name
16:34:15,168 DEBUG [repo.jscript.ScriptLogger] Keywords
16:34:15,168 DEBUG [repo.jscript.ScriptLogger] createSubCategory
16:34:15,168 DEBUG [repo.jscript.RhinoScriptProcessor] Time to execute script: 9
4ms
16:34:15,168 ERROR [ui.common.Utils] Failed to run Actions due to error: Failed
to execute script 'workspace://SpacesStore/6fd4fc54-7568-11dc-95d4-b5c864bcc81a'
: Failed to execute script 'workspace://SpacesStore/6fd4fc54-7568-11dc-95d4-b5c8
64bcc81a': TypeError: Cannot find function createSubCategory. (AlfrescoScript#10
)

Outcomes