I've got a custom site definition with a list definition + list instance in it. In the schema.xml for the list, I tried adding multiple views for the list. The problem I have is that although the custom views are being deployed, some properties seem to be ignored for some reason.

For example; I have defined some other ViewFields to be shown in one of the non-default views. But after deployment, that custom view shows exactly the same columns as the default view has. Same goes for the Query, that isn't deployed as well.

Here's my view def:

<View Name="{5BB1D385-0E92-42D0-8348-8E81F90D2688}" MobileView="TRUE" Type="HTML" 
        DisplayName="Verzonden orders" Url="VerzondenOrders.aspx" 
        BaseViewID="1" ImageUrl="/_layouts/images/generic.png"
      <FieldRef Name="Attachments" />
      <FieldRef Name="Ordernummer" />
      <FieldRef Name="Commissie" />
      <FieldRef Name="Datum_x0020_besteld" />
      <FieldRef Name="Datum_x0020_verzonden" />
      <FieldRef Name="Order_x0020_status" />
        <FieldRef Name="Ordernummer" />
          <FieldRef Name="Order_x0020_status" />
          <Value Type="Text">Verzonden</Value>
    <RowLimit Paged="TRUE">30</RowLimit>
    <XslLink Default="TRUE">main.xsl</XslLink>
    <Toolbar Type="Standard" />

Who can help me out?

  • I can't say I've seen a great number of these (sheltered life, I know), but I haven't seen a GUID in the Name attribute before...
    – Stu Pegg
    Apr 21, 2011 at 10:40

4 Answers 4


Do you have a unique BaseViewID for every view?

I noticed that in your sample view that the Url attribute is VerzondenOrders.aspx and the BaseViewID attribute is 1. Usually 1 is the BaseViewID of AllItems.aspx. If you copy and pasted your custom views from AllItems.aspx, you need to make sure to change the BaseViewID in addition to the URL and DisplayName.

I suppose that it is possible that if all your views have a BaseViewID of 1 that SharePoint is using the ViewFields definition from the first entry (AllItems.aspx), which could explain the behavior you are seeing.

  • Hello Rich, sounds plausible. But 'BaseView' sounds like a 'ViewType' kind of thing; so that why I didn't change it. I'll try changing it to see what happens, thanks.
    – Jasper
    Apr 26, 2011 at 14:28
  • That was it man, thanks so much. Stupid little error which I overlooked :)
    – Jasper
    Apr 26, 2011 at 14:50

Not sure if you have manually created your xml, but one way to find errors is to design the list through the browser first, then save the site as a template through site setting (/_layouts/savetmpl.aspx), download the wsp from the solution gallery, extract the files from it, and compare your schema.xml against the schema.xml in the wsp.

  • you beat me to it :-) Apr 21, 2011 at 10:15
  • Ok. So I corrected the list in the browser. Exported the site to WSP and imported is. Copied the exact view definition from the export into my project and tried again. Result is still the same: it just doesn't work. I get my first view 2 times, the second definition is ignored.
    – Jasper
    Apr 21, 2011 at 13:16
  • Maybe you should copy the whole list definiton to avoid inconsistencies between fieldnames in list and fieldrefs in view. Am pretty sure there is something funny going on in your xml. Apr 26, 2011 at 8:41

How did you create the view? Did you export the schema from an existing site or copy an existing view? I recommend exporting either site or list as template, open them in Visual Studio (import site) and get the view from there.

Also do the fields exist in the content type?

  • Yes, the fields exist. I copied the default view (which is deployed correctly) and swapped one field and the where clause of the query. When I open up SPD and edit the viewpage, I can paste in my definition from schema.xml and it works ok :S
    – Jasper
    Apr 21, 2011 at 13:05
  • Do try to build everythibg as you want it and export as template. Then i import i to vs project Apr 21, 2011 at 22:33

Do the columns defined in the ViewFields exist in the list definition. And are these columns created when the list is created?

  • Yes and Yes, since it all works fine for the default view. It's just the additional custom view which isn't deploying properly.
    – Jasper
    Apr 21, 2011 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.