我有以下CAML查询:
<OrderBy>
<FieldRef Name='Glossary' Ascending='True' />
</OrderBy>
但输出是在创建日期排序列表。如何根据自定义列打印列表项?
答案 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>