SharePoint订单列表项不是创建日期,而是按升序排序

时间:2014-03-05 11:43:05

标签: sharepoint sharepoint-2010 sharepoint-list

我有以下CAML查询:

<OrderBy>
  <FieldRef Name='Glossary' Ascending='True' />
</OrderBy>

但输出是在创建日期排序列表。如何根据自定义列打印列表项?

1 个答案:

答案 0 :(得分:0)

确保您将OrderBy放在正确的位置。您的CAML查询应如下所示:

<listName>Program Roadmap: Tracking Development Hours</listName>
<viewName></viewName>
<query>
  <Query>
    <OrderBy>
      <FieldRef Name="Date" Ascending="true"></FieldRef>
    </OrderBy>
  </Query>
</query>
<viewFields>
  <ViewFields Properties="True">
    <FieldRef Name="ID"></FieldRef>
  </ViewFields>
</viewFields>
<rowLimit>0</rowLimit>
<queryOptions>
  <QueryOptions>
    <DateInUtc>False</DateInUtc>
    <Paging ListItemCollectionPositionNext=""></Paging>
    <IncludeAttachmentUrls>True</IncludeAttachmentUrls>
    <IncludeMandatoryColumns>False</IncludeMandatoryColumns>
    <ExpandUserField>False</ExpandUserField>
    <ViewAttributes Scope="Recursive"></ViewAttributes>
  </QueryOptions>
</queryOptions>