CAML OrderBy onlt works for certain fields

37 views Asked by At

So, this OrderBy works

<Query> <OrderBy> <FieldRef Name="Title" Ascending="True"/> </OrderBy> </Query>

and this one doesn't

<Query> <OrderBy> <FieldRef Name="SortOrder" Ascending="True"/> </OrderBy> </Query>

I'm at a loss. Both are fields in my SharePoint List, SortOrder was a "Number" but I changed it to a "Single Line of Text" (same as Title).

Note: If I remove the tag NO OrderBy works.

1

There are 1 answers

0
Will T On BEST ANSWER

Well, it turns out that this is an "Internal Name" issue. The creator of the list originally named the field "Sort Order" then changed it to "SortOrder". So the internal name is "Sort_x0020_Order".

Duh.

Thanks everyone for your input.