Jump 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.

Creating a Script for Sorting

Featured Replies

  • Newbies

I am a novice FMP user, and have a question about creating a script for sorting. In FMP6, there is a database template for Personnel Records. In "List" view, there are column headers for several fields that, when clicked on, toggle between sorting the column alphabetically ascending/descending. I have tried following the Sorting scripts in the template to make columns for additional fields, to no avail. I seem to be missing a way to define a value in the Sort Ascending and Descending scripts (for example, in the Set Field line, there is reference to the term "departmentA" in the Sort Department Ascending script) and I don't know how to define this value for other fields. Can anyone out there help me? THANKS in advance!

In FileMaker 6 and earlier versions (not in FM 7 or 8), you need to perform the sort manually and then create the script with the restore option. You need to repeat this process for every sort script you want to create.

  • Author
  • Newbies

Thanks very much for taking the time to answer my query. I wound up with 2 programs, an ascending and descending sort, but cannot coordinate them with a master script that toggles them when clicking on the column header (button). Tried looking at the scripts for other column headers, but again, they refer to values such as, If ["HiliteSortedBy = "firstNameA"]... which I don't know how to define. Not only that, but the other scripts cause a nice little triangle to point up or down for ascending and descending sorts, too. Sorry, probably should have specified "Beginner" not "Novice"!

Hi, create an additional global number field for each field (column) you want to sort on. Let's call it gSortField1.

In your master Sort script, you do the following :

If [gSortField1=0]

Perform Script["Sort Ascending"]

Set Field [gSortField1=1]

Else

Perform Script ["Sort Descending"]

Set Field [gSortField1=0]

End If

You could of course do this in one script as well, using the Sort Script step in stead of the Perform Script step

Regards,

Peter

  • Author
  • Newbies

Great, thanks!

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.