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.

Dynamic Sorting Script?

Featured Replies

I would like to make a single script to sort the records I am browsing in list view. I want to mimic the windows GUI where users expect to be able to click on a column header and have the data sorted ascending or descending based on the column clicked.

I can do this now with numerous sort scripts but there must be a way to script a sort where the fields to sort by are passed via a calculation or get(ScriptParameter) or something like that. I would prefer not to make a huge if/else list script.

Just trying to keep the scripts to a minimum. Any ideas oh gurus?

You might try a global to hold the last sort field and whether it was ascending or descending. Then use script parameters to tell the sort script which field to sort by. If the new sort field is the same as the last sort field, then change the ascending/descending choice.

Then use the If-Then-Else branching with multiple Sort script steps to branch to the correct Sort. It's possible to eliminate most of this by using a separate global for the sort field name and a calc defined with a GetField(gSortField) function. Then you'd only need two Sort script steps to sort by this calc ascending and descending. You may have to convert date, time, and numbers a bit to make them sort correctly with this text calc.

  • 2 weeks later...

I am trying to set-up something similar, but I would like to perform dynamic sorts with multiple keys in various order. So far I have defined a checkbox set which list the available keys. I have associated this checkbox set with a global field g.SortList. As I click on the individual check boxes the desired key order is stored in g.SortList.

So far so good. Now I would like to perform a sort using the stored list in g.SortList, but I can't find a way to perform either a sort based on the list or a number of successive sort based on each list item. However, I found that AppleScript may be able to do this:

sort v : Sort the records in a layout

sort reference : The layout to sort

[by reference] : The fields to sort by

[in order ascending/descending/custom] : The sort type

Is this really the only way?

Use calculations like

GetField(Substitute( MiddleValues( g.SortList; X; 1 );

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.