Hello
I am having trouble sorting a query by multiple fields. The following works:
Result := Components.ObjectManager.Find<TFormTypeInfo>.Where(Linq[STRfIsDeleted] = 0).OrderBy('FormName').List;
But if I try to sort on multiple fields
Result := Components.ObjectManager.Find<TFormTypeInfo>.Where(Linq[STRfIsDeleted] = 0).OrderBy('Scope, FormName').List;
I get an error
'Property "Scope, FormName" not found on class...'
I am certain that there is a property and a column named 'Scope'.
How can I sort on two columns?
Thanks
David
Hello David,
You must use multiple OrderBy:
Result := Components.ObjectManager.Find<TFormTypeInfo>
.Where(Linq[STRfIsDeleted] = 0)
.OrderBy('Scope')
.OrderBy('FormName')
.List;