I have something like this:
SPQuery query = new SPQuery(); query.Query = "<OrderBy><FieldRef name=\"MyTerm\" /></OrderBy>"; myList.GetItems(query);
I can sort on normal fields, but it refuse to sort on my managed metadata field. Any ideas?
One thing I've noticed in 2010 is that the OrderBy won't work if you're not returning the field name explicitly in the query.ViewFields property. So try adding:
to your code.
Maybe you can try to write 'name' as 'Name'. Does the column allow multiple values?