cancel
Showing results for 
Search instead for 
Did you mean: 

Create a folder with a template folder

roseta
Champ in-the-making
Champ in-the-making
I would like to create (in Javascript) a folder according to an already existing folder as a template. Is that possible? So far, I just know how to create an empty folder, but I would like to create a folder, with some folder structure, rules and permisions inside. Anyone can give me a hand? Thanks a lot!

My js code by now is the following:



var origin = bpm_package.children[0].parent;                              
var destination = origin.createFolder("New folder");

3 REPLIES 3

fstnboy
Champ on-the-rise
Champ on-the-rise
Hi roseta,

Yes, that's possible. You just need the noderef of the space template you want to copy:


var spaceTemplate = companyhome.childByNamePath("/Data Dictionary/Space Templates/<Folder Name>");


if (spaceTemplate != null) {
       var origin = bpm_package.children[0].parent;                             
       var destination = spaceTemplate.copy(origin, true);
}


That should work. Just replace the <Folder Name> with the space template name you want to copy.

Regards,
Adei

roseta
Champ in-the-making
Champ in-the-making
Thanks, that works! 😃

fstnboy
Champ on-the-rise
Champ on-the-rise
Could you give me a point if so?

Thanks!