0

I was wondering how can I programmatically copy all the discussion items from one Sharepoint team discussion to another?

I have tried retrieving the team discussion items from an existing site as SPListItem. Although I could find the Team Discussion list, but I could not red the retrieved items by assigning them as SPListItems. Moreover, team discussion looked like it has a lot of fields that requires a lot of other information to be available e.g. users, threads, topics, etc. It certainly looks different than other ordinary lists. Would a simple copying of all the fields be sufficient, or there is more to it?

Thanks.

BeraCim
  • 2,317
  • 8
  • 49
  • 78

1 Answers1

1

Internally, discussion boards are standard SharePoint lists. The most likely source of confusion is that topic is a subtype of folder - as long as you maintain that folder structure you should be able to copy items between lists.

Tom Clarkson
  • 16,074
  • 2
  • 43
  • 51
  • @Tom Clarkson: so apart from the "topic", which I should treat it as a folder, the replies are just listitems, not files? – BeraCim Apr 16 '10 at 09:51
  • @Tom Clarkson: I guess what I dont understand is how should I treat the items inside the Team discussions... should I treat them as SPFiles, or SPListItems? – BeraCim Apr 16 '10 at 10:10
  • Unless you have attachments, there are no files involved. – Tom Clarkson Apr 16 '10 at 10:45
  • So I have to treat SPFolder as SPList, then treats the things in SPFolder as SPListItems? :S – BeraCim Apr 16 '10 at 11:13
  • No, it's a sharepoint folder (a type of item), not a file system folder. – Tom Clarkson Apr 16 '10 at 12:02
  • An SPFolder counts as an SPListItem for purposes of moving it around. I would be careful about moving them, though. See [this question](http://stackoverflow.com/questions/2588605/negative-itemcount-in-sharepoint-document-library), which while it has to do with document libraries, it might affect this kind of folder system as well. – Grace Note Apr 16 '10 at 12:49