As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
I wrote this code in a webscript controllervar newFolderName="Configuration";var newFolderNode=companyhome.childByNamePath(newFolderName);if (newFolderNode === null) { //which means newFolder does not exists, so create it newFolderNode=companyhome.createFolder(newFolderName);}
and I'm getting "companyhome" not defined. I found this post https://community.alfresco.com/thread/169855-companyhome-not-defined but it didn't fix the error.
I assume you are writing your web script on the Share-tier in a directory called site-webscripts, am I correct? Web scripts on the Share-tier do not have access to the Repository root scope objects. You need to write a Repository-tier web script for such objects to be used.
yes I am writing the web script on the Share-tier.So I should write this code in a Repository-tier web script, then return an object that contains the new folder properties ?Thanks.
Available root objects in Repository-tier webscript.
https://docs.alfresco.com/5.2/references/API-JS-rootscoped.html