Is it possible to create a view on a list that you have created via the ListInstance element at the same time as you activate the Feature? For example I have the following as my Elements.xml:
<?xml version="1.0" encoding="utf-8" ?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ListInstance Title="Favourite Albums" FeatureId="00BFEA71-DE22-43B2-A848-C05709900100" TemplateType="100" Id="11111" Description="Simple generic custom list sample to store albums." Url="Lists/MyCustomList" OnQuickLaunch="true" RootWebOnly="false" > <Data> <Rows> <Row> <Field Name="ID">1</Field> <Field Name="Title">Machine Head</Field> </Row> <Row> <Field Name="ID">2</Field> <Field Name="Title">Rubber Soul</Field> </Row> </Rows> </Data> </ListInstance> </Elements>
Ideally I would like to create a view using CAML at the same time using something like a View element. I know I could use code inside the FeatureActivating event.
As yet I can't find any way to do this and it looks like it may not be possible. Would I have to use a ListTemplate element and a Schema.xml file? Any ideas? I am using Windows SharePoint Services 3.