Pregunta

I'm trying to return a list and order it by a choice field.

My choice field currently is just set to Yes or No.

The XML I'm using:

<View><Query><OrderBy><FieldRef Name="TestSort"/></OrderBy></Query></View>

I've also tried the properties in all combinations like:

<View><Query><OrderBy Override = "TRUE"><FieldRef Ascending = "TRUE" UseIndexForOrderBy = "FALSE" Name="TestSort"/></OrderBy></Query></View>

If I change the xml to either a date field or text field it works perfectly?

<View><Query><OrderBy><FieldRef Name="Created"/></OrderBy></Query></View>
<View><Query><OrderBy><FieldRef Name="Title"/></OrderBy></Query></View>

I've also tried using GroupBy rather than OrderBy but just cant get it working!!! Anybody have any ideas?

¿Fue útil?

Solución

The first line of XML you posted should work.

As Eric suggested confirm that the column name is correct.

Another thing to check is if the column allows multiple selections. You won't be able to sort if this is a multiple selection choice column.

Licenciado bajo: CC-BY-SA con atribución
scroll top