Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Toggle sort ascending/descending

Featured Replies

Hi.

I have a column that I want users to be able to click the column header and toggle between the data sorting ascending and descending. I know that two seperate buttons will do the trick, but want to know if there's a way I can either detect a columns sort status, or have some sort of toggled status I can refer to to then run a script.

Any ideas please?

Greg

Is this in a portal or on a list layout? If it's a list layout you would simply call a script to sort the records, and then set a flag as "ascending" or "descending" When you call the script again, just branch the script to sort the opposite way and reset the flag. Open one of the built-in templates and look at the scripts used for sorting the list view

If you're sorting a portal, then it's trickier, but there are many methods if you search the forums for portal sorting.

  • Author

Hi.

Its a list Im sorting. Please explain how I can setup, toggle, and then subsequently read this flag.

Thanks for your response by the way.

Greg

If[ $$sortOrder = "Asc" ]

Sort Records[ do your descending sort here ]

Set Variable[$$sortOrder ; "Desc" ]

Else

Sort Records [ do your ascending sort here ]

Set Variable[ $$sortOrder ; "Asc" ]

End If

You can then at any time retrieve your current sort order as it is stored in the $$sortOrder variable.

  • Author

Many thanks for your help.

I should be able to take it from here.

Greg :)

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.