views:

3370

answers:

3

I've created a custom list & also added a column in the Announcement List. Question is, how can I include those newly created items when I create a fresh Web Application (like a script, feature or something)?

Additional Info: It's like when you're to deploy from your development machine to a staging or production server. I'd like to have a script or something to update my production server to have the new column i've added to the Announcement List. Just like SQL Server's ALTER TABLE command to update a SQL Server Table.

Is there an equivalent in Sharepoint Lists?

TIA!

+1  A: 

Your question is not very clear but I think you may want to look at Application Templates.

Microsoft provide 40 pre-built templates in the link below and the same technology is available to you. Links from this page should lead you to information showing you how you can crate your own.

Application Templates for Windows SharePoint Services 3.0 http://technet.microsoft.com/en-us/windowsserver/sharepoint/bb407286.aspx

Ryan
+2  A: 

You might be able to achieve this with site templates as detailed here

specifically the export function should let you download and re-use a template.

this functionality works similar in the context of list templates IIRC; though doubt it will help for site columns

getting a little more advanced you can try the SharePoint solution generator that is part of the Visual Studio 2005 Extensions:

SharePoint Solution Generator

This stand-alone program generates a Site Definition project from an existing SharePoint site. The program enables developers to use the browser and Microsoft Office SharePoint Designer to customize the content of their sites before creating code by using Visual Studio.

+1  A: 

Regarding the new custom list, this can be done using features. See How to: Create a Custom List Definition for more information. The Visual Studio Extensions for SharePoint (VS2005 / VS2008) will help you to extract the list definition if you've created it through the SharePoint UI. If you are fortunate enough to be using a custom site definition and don't have any webs created yet, you can set your site definition to create the custom list using feature stapling.

If you are attempting to apply these changes to webs that already exist, you can still use a feature to define your custom list. It will just appear as a type of list that can be created. Then to have the custom list automatically created for existing webs or to modify existing lists such as the Announcements list, you can use a feature receiver. This allows you to run any custom code when the feature is activated. See the MSDN article Feature Events for more information.

Alternatively, you could not use features at all as they can be difficult, time consuming and painful. In fact, this blog post has a good argument against the idea. You could try the tool mentioned on that page or other applications such as DocAve Content Manager and SharePoint Site Migration Manager.

Alex Angas