Idea: Model sorting action

  • 2
  • Idea
  • Updated 12 months ago
  • Under Consideration
It would be convenient to be able to sort a model by a specific field using the actions framework.
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb

Posted 3 years ago

  • 2
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
You can run a one-line snippet, like so:
skuid.$M('MyModel').orderByClause = 'Date__c DESC';
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
That'll work! Thanks
(Edited)
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,240 Points 5k badge 2x thumb
Matt, thanks for sharing that awesome snippet! 

Raymond, I will mark this as an idea for our developers to consider for future releases.

Thanks!
Karen
Photo of Conlan O'Rourke

Conlan O'Rourke

  • 3,280 Points 3k badge 2x thumb
What am I missing to make this work?


Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
I don’t see anything wrong with the snippet. Make sure all your names are correct. I can’t remember if you have to requery after the snippet. Give that a try.
Photo of Conlan O'Rourke

Conlan O'Rourke

  • 3,280 Points 3k badge 2x thumb
Doh, I was missing the follow-up query action. Thanks!