var parentNodeId = 'User Homes/',
spaceName = 'facturas',
spaceTitle = "Carpeta de pruebas" ,
spaceDescription = "Descripcion de la carpeta de pruebas"
var nodeNew;
var nodeParent = search.findNode("workspace://SpacesStore/" + parentNodeId);
nodeNew = nodeParent.createFolder(spaceName);
// Always add title & description, default icon
nodeNew.properties["cm:title"] = spaceTitle;
nodeNew.properties["cm:description"] = spaceDescription;
nodeNew.properties["app:icon"] = "space-icon-default";
nodeNew.save();
"message" : "04100347 Failed to execute script 'workspace:\/\/SpacesStore\/6b697df7-38b1-4a87-804d-5426c80d8b1c': 04100346 TypeError: Cannot call method \"createFolder\" of null (workspace:\/\/SpacesStore\/6b697df7-38b1-4a87-804d-5426c80d8b1c#8)",
"exception" : "org.alfresco.scripts.ScriptException - 04100347 Failed to execute script 'workspace:\/\/SpacesStore\/6b697df7-38b1-4a87-804d-5426c80d8b1c': 04100346 TypeError: Cannot call method \"createFolder\" of null (workspace:\/\/SpacesStore\/6b697df7-38b1-4a87-804d-5426c80d8b1c#8)",
var nodeParent = search.findNode("workspace://SpacesStore/" + parentNodeId);
var num=space.children.length;
var nodeNew1;
nodeNew1 = space.children[num-1].createFolder('facturas');
nodeNew1.properties["cm:title"] = "Facturas";
nodeNew1.properties["cm:description"] = "Carpeta para las facturas";
nodeNew1.properties["app:icon"] = "space-icon-default";
nodeNew1.save();
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.