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
Post a Comment