Newbies stingray Posted May 30, 2006 Newbies Posted May 30, 2006 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!
John Mark Osborne Posted May 30, 2006 Posted May 30, 2006 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.
Newbies stingray Posted May 30, 2006 Author Newbies Posted May 30, 2006 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"!
PeterHW Posted May 31, 2006 Posted May 31, 2006 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
Recommended Posts
This topic is 6753 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now