copy list items from one list to another in sharepoint

前端 未结 11 2079
无人共我
无人共我 2020-12-14 20:35

In Sharepoint how can you copy a list item from one list to another list eg copy from \"List A\" to \"List B\" (both are at the root of the site)

I want this copying

11条回答
  •  感动是毒
    2020-12-14 20:46

    Indeed as Lars said, it can be tricky to move items and retain versions and correct userinfo. I have done similar things with that before so if you need some code examples, let me know through a comment and can supply you with some guidance.

    The CopyTo method (if you decide to go with that) need an absolute Uri like: http://host/site/web/list/filename.doc

    So, if you are performing this in an event receiver you need to concatinate a string containing the elements needed. Something like (note that this can be done in other ways to):

    string dest= 
     siteCollection.Url + "/" + site.Name + list.Name + item.File.Name;
    

提交回复
热议问题