Tuesday, May 17, 2011

Copy listitems from one custom list to another, then move them into subfolders.


SPListItem listItem = web.GetListItem(listItemUrl);
listItem.CopyTo(destinationUrl); // Copies the item to the specified destinations
or
listItem.CopyFrom(sourceUrl); // Overwrites the current item with the specified version of the item.

SPListItem item = Web.Lists["Announcement"].GetItemById(5);
SPFile file = Web.GetFile(item.Url);
file.MoveTo("New location...with the ID_.000");


No comments:

Post a Comment

Thank you for Commenting Will reply soon ......

Featured Posts

Enable shared folders in ubuntu in vmware?

 To enable Shared Folders in Ubuntu (VM) on VMware , follow these steps: Step 1: Enable Shared Folders in VMware Settings Power...