BizTalk Utilities CV ,   Jobs ,   Code library
 
Go to the front page to continue learning about XML or select below:

Contents

ReBlogger Contents

Previous posts in XML

 
 
Page 2831 of 19626

How to define indexed column in SharePoint list in schema.xml file

Blogger : Evgeny Tugarev
All posts : All posts by Evgeny Tugarev
Category : XML
Blogged date : 2008 Jul 09

In the top-level SharePoint list views I often order items by the "Last Updated" column. Corresponding xml fragment of the list schema.xml looks like

<View  BaseViewID="0" Type="HTML" ContentTypeID="0x012001">......
       <Query>
          <OrderBy>
            <FieldRef Name="DiscussionLastUpdated" Ascending="FALSE">
            </FieldRef>
          </OrderBy>
        </Query>
</View>

When a SPList contains large number of items it is also vital to define "Last Updated" as indexed column to keep having good performance. Go up to the field definitions and add  Indexed="TRUE"  property to the "Last Updated" field.

<Field ID="{59956c56-30dd-4cb1-bf12-ef693b42679c}" Name="DiscussionLastUpdated" DisplaceOnUpgrade="TRUE" ... Indexed="TRUE">

And don't forget to rebuild you .wsp if you have one

Cheers,

Evgeny Tugarev


Read comments or post a reply to : How to define indexed column in SharePoint list in schema.xml file
Page 2831 of 19626

Newest posts
 

    Email TopXML