Unanswered Archive list items with version history and custom forms

  • Tuesday, March 24, 2009 4:18 PM
     
     
    Hi,

    I have a SharePoint list that has custom forms and makes use of SharePoint's OOTB versioning capabilities.  However, this list grows over the course of a year and I have a need to move or archive items for the year to another identical SharePoint list at the end of the year.  See the example below.

    OriginalList (this is the list that grows over the course of the year as users add data to it)
    --uses versioning
    --has custom new, edit, and display forms

    ArchiveList (this is the list that contains ONLY those list items for a particular year)
    --should retain ALL versions from OriginalList
    --should use ITS OWN custom forms that ARE IDENTICAL to the ones in OriginalList

    I've looked into saving a list as a template with the data; the problem is that is does not include the version history.  It only saves the latest version into the list template.

    I've created a program that successfully moves items from one list to another and INCLUDES the version history, so my next step is to modify that to copy the custom forms to the new list and make sure they're properly associated with the new list.  Before I start going down that road, does anyone know of an existing solution out there that already does all this?

    Thanks,

    Eric Skaggs
    Colorless Green Ideas Sleep Furiously

All Replies

  • Tuesday, March 24, 2009 7:10 PM
     
     
    Eric,

    I have gone through this requirement twice on two different customers. I will provide you the some code to help you on this. I have done it in following way, i was doing it for publishing page library but same can be applied on the list.

    - Created a Timer Job which runs one a day in evening to archive items.
    - Created Identical Archive list with the same name as the list with a suffix like ListA_Archive.
    - Created a Layout aspx application to test my code.
    - Code was pulling all items using camel query from more than one lists. so that it was generic code for any list using specific content type. Once i get the list items, i get the SPlist object of that list item and i locate _Archive List. Once found, i move versions to archive list along with final published version. This way a list item moves with versions from one to another list.

    I hope above notes will help you to start thinking about it. I will some some code snippets so you can complete it.

    Regards,

    Moonis Tahir
    MCSD.net, MCTS Sharepoint
  • Tuesday, March 24, 2009 9:42 PM
     
     
    Eric,

    this is maybe a stupid question, but to keep it simple why don't you use a content type and associate the content type with custom forms ? when you create you archive list you associate it with the same content type and you get your forms

    Serge Luca
    Serge Luca (MVP); blog: www.redwood.be Sharepoint and Workflow consulting in EMEA
  • Wednesday, March 25, 2009 2:09 PM
     
     
    Thanks for the replies.  I'll start looking into these solutions asap...the first one is the one I'll need to use.  The second suggestion about using content types won't work in my case because I'm not manually creating the archive list.  I have a list template based on OriginalList that does not include the data in OriginalList.  My solution creates the archive list based on the list template, and as a result still uses the custom forms that are in OriginalList because those are the ones that the list template is pointing to.

    Colorless Green Ideas Sleep Furiously
  • Thursday, August 16, 2012 2:26 PM
     
     

    Hi Eric,

    i know this is an old post but i'll try my luck in any case...

    i am strugling to find a way to move items from one list to another without loosing the version history. I could not imagine that SP doesn't offer this by default, but anyway i do need to implement this functionality.

    I read in the first post that you wrote some code for this purpose so i was hoping you could share it.

    We run a SP Server 2007, and i have never used c# before...

    Thanks in advance

    Paolo

  • Thursday, August 16, 2012 2:32 PM
     
     

    Hi Paolo,

    You're right, it's been a while.  I don't have the code handy, but there's a chance it might be on an external hard drive I have at home.  I'll see if I can find it and get back to you.  If I can't find it, I'll try to find time to rewrite it and post it here.  Maybe I'll have some time this weekend...who knows?  :-)

    In the meantime, I've got your message in email and have it flagged so that I don't forget...well, so that I shouldn't forget anyway.

    Feel free to bug me at skaggej@hotmail.com (haven't made the switch to Outlook.com yet) if I don't get back to you on this within a few days.

    Eric


    Colorless Green Ideas Sleep Furiously http://www.sharepointnerd.com

  • Saturday, August 18, 2012 6:57 PM
     
     

    Paolo,

    Found it!  Here you go:  http://www.sharepointnerd.com/blog/Lists/Posts/Post.aspx?ID=53.  I was able to post the actual source code that made it work for us back in 2009, but am not able to post the entire solution.

    I'm hopeful that you can work with someone who has used C# before to adapt this to meet your needs.  I don't think it will meet your needs as-is because several things are hard coded and would surely need to be changed.

    Please let me know if you find this helpful.  I would gladly work with you to get this to meet your needs, but my time is allocated to writing a course at the present time and I can only get away from that for short periods of time.  If you have a specific timeframe that you need to meet or want to discuss working with this further, please send me an email at skaggej@hotmail.com and I'll respond as soon as I can.


    Colorless Green Ideas Sleep Furiously http://www.sharepointnerd.com


    • Edited by Eric Skaggs Saturday, August 18, 2012 6:59 PM Bad link...had to fix it.
    •