Duplicate a SharePoint list -


is there way duplicate sharepoint list code wise?

judging sharepoint tag, i'm assuming meant ask "how copy sharepoint list (splist) programmatically?"
without testing (or trying compile it), like:

spweb web; /* add code initialize current web */ splist sourcelist = web.lists["nameofsourcelist"]; sourcelist.saveastemplate("templatefnm.stp", "templist", "templistdescription",                            true /* include list content */); splisttemplate template = web.listtemplates["templist"]; web.lists.add("newlistname", "newlistdescription", template); web.update(); splist newlist = web.lists["newlistname"]; 

also, here's link blog post achieves same accross web applications.

and word of advice: you'll better search results if use "programmatically" instead of "code wise".

hope helps.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -