1
votes

I am quite new in Sharepoint. I am working on sharepoint 2013. I have created a content type with Visual Studio.

I have written a query to sort the columns.

<OrderBy>
  <FieldRef Name='Order' Ascending='True' />
  <FieldRef Name='SortingOrder' Ascending='False' />
  <FieldRef Name='IsFeatured1' Ascending='False' />
  <FieldRef Name='Created' Ascending='False' />
</OrderBy>"; 

I just want to know which column will execute first. I am quite unable to understand the flow.

I want order something like that..

  1. IsFreatured1
  2. SortingOrder
  3. Order
  4. Created
1

1 Answers

0
votes

The order in which the fields appear in the <OrderBy> node, is the order in which they are sorted.

So, to get the requirement you specified in your question, you have to use this OrderBy statement:

<OrderBy>
  <FieldRef Name='IsFeatured1' Ascending='False' />
  <FieldRef Name='SortingOrder' Ascending='False' />
  <FieldRef Name='Order' Ascending='True' />
  <FieldRef Name='Created' Ascending='False' />
</OrderBy>

https://msdn.microsoft.com/en-us/library/office/ms467378.aspx