You are welcome, Euge, yes it changes the IContentType for the current Content object and removes PropertyTypes and Properties, which are not part of the new ContentType. Please use with caution as this remove differences between the new and old ContentType.
Also, it's db operation so it can be long operation if you want to do it in the loop with tons of nodes.
Loop through content tree and change document type
Hi
I need to loop through a list of nodes and change their document type to a new doc type. I need to do this programmatically. Any ideas?
Hi Euge
You can change document type of content item with this code:
Thanks,
Alex
OK thanks Alex so will this automatically map all the doc type properties to new GUIDs?
You are welcome, Euge, yes it changes the IContentType for the current Content object and removes PropertyTypes and Properties, which are not part of the new ContentType. Please use with caution as this remove differences between the new and old ContentType.
Also, it's db operation so it can be long operation if you want to do it in the loop with tons of nodes.
is working on a reply...