cancel
Showing results for 
Search instead for 
Did you mean: 

Use JavaScript to set an incoming document to a content type

bengrah
Champ on-the-rise
Champ on-the-rise
Hi all

One of our requirements are when we add a document to a folder, we run a script that allows us to set that document as a specific Content Type.  Now, in our Alfresco build we have a content type called Group IT Legal Doc. What we want to do is, when you add a file into the folder, make that document of type Group IT Legal Doc.

I've been looking around and so far I haven't found anything that allows you to do this explicitly, so is it possible? I know you can create nodes of specific content types, but that's not quite the same.
2 REPLIES 2

marcoq82
Champ in-the-making
Champ in-the-making
Try adding a business rule on all items with action "Specialize type" and selecting your content type. Hope it helps

bengrah
Champ on-the-rise
Champ on-the-rise
You can use the JavaScript method specializeType() (note the 'z') to change any file to another type of content. Does the same job as Specialize Type but it could be useful for batch updating. Thanks Marco