Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Streety 358 posts 568 karma points
    Jan 16, 2015 @ 13:48
    Streety
    0

    Change Doc Types "en masse" from a nodeID to apply to children

    Hello,

    Due to the number of items In a sub folder I have implemented Anthony Dang great Auto Folders project which is working well under ver 7.1.4.

    However I now need to change a load on nodes to a differnet DocType.

    I know you can manually change the content DocType thru the GUI but I have thousands to do and I need an automated solution / scripted etc.

    The script needs to start at a certain NodeId and change all the children with a certain DocType to a new Doctype, whilst ignoring other node types.

     

    Can this be done.

     

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Jan 16, 2015 @ 14:47
    Richard Soeteman
    1

    This feature is high on the list for Bulkmanager http://soetemansoftware.nl/bulkmanager. I hope to have something ready end of next week.

    Otherwise loop over the items and change document type in code.

     var node = ApplicationContext.Current.Services.ContentService.GetById(123);
     node.ChangeContentType(ApplicationContext.Current.Services.ContentTypeService.GetContentType("MyAlias"));
     ApplicationContext.Current.Services.ContentService.Save(node);
    

    Best,

    Richard

  • Streety 358 posts 568 karma points
    Jan 16, 2015 @ 15:46
    Streety
    0

    Actually,

    I think I have figured another fix where I don't need to change the docType but I change the parent.

     

    I'll try your code.

    Thanks for the prompt reply

Please Sign in or register to post replies

Write your reply to:

Draft