Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do i add a view to schema.xml in sharepoint

Tags:

sharepoint

I am trying to add a view to a custom list. The target is MOSS 2007, I am using VS2008 w/ VSeWSS 1.3. The feature already has a custom list definition, including a custom view called "Calendar". To get started I thought I'd create another view called NewCalendar that is simply a duplicate of the existing custom view Calendar.

So, I copied Calendar.aspx to NewCalendar.aspx, copied the existing "View" node for the current calendar and pasted a new node, then changed the following attributes of the new node: DisplayName, Url, and DefaultView.

When I refresh WSP View NewCalendar.aspx shows up. When I deploy and go to NewCalendar.aspx i get a 404. Using SharePoint Manager I confirm the page is not present.

How do I add a custom view via a feature so that it shows up in the "View" drop-down?

UPDATE: It works if I create a new instance of my custom list. How do I get the custom view to show up on existing lists?

like image 346
Chloraphil Avatar asked Nov 05 '22 21:11

Chloraphil


1 Answers

Unfortunately features in general are not retroactive. You cannot update a feature and expect all existing items that were created from that feature to be updated. This i assume is by design. If this were possible it could potentially have far reaching (unexpected) consequences.

In these senario's i script out a retrofit script, when publishing the new feature.

like image 183
Robert Sweeney Avatar answered Nov 12 '22 13:11

Robert Sweeney