Is it possible to use a!sortInfo to sort by field1 and then by field2?

Is it possible to use a!sortInfo to sort by field1 and then by field2?

I tried the following code, but I am getting an error " Invalid Cast: Cannot cast from type 'PagingInfo' to type 'Date': CastInvalid"

a!sortInfo({
{field:"field1",ascending:false)},
{field:"field2",ascending:false)}
})

OriginalPostID-141868

OriginalPostID-141868

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    You could run the queryEntity without sorting, and then push that through a todatasubset(), applying the sorting. Depending on the size of your dataset this may be a slow way to do what you want.

    You could also add a column that is some sort of combination of the multiple columns you want to sort by (e.g. column1.column2), and then sorting by only this new column will essentially sort by column1 then column2.
Reply
  • 0
    Certified Lead Developer
    You could run the queryEntity without sorting, and then push that through a todatasubset(), applying the sorting. Depending on the size of your dataset this may be a slow way to do what you want.

    You could also add a column that is some sort of combination of the multiple columns you want to sort by (e.g. column1.column2), and then sorting by only this new column will essentially sort by column1 then column2.
Children
No Data