July 7, 200322 yr How can I perform a default sort everytime my database is opened? The "Sort" script step seems like the best it can do is repeat the last sort, but if the database is just opened, it doesn't remember the last sort. Also, what is the default sort order? Regards, EMC
July 7, 200322 yr The way the sort script step works is: 1) You perform a manual sort 2) Then add the sort script step to your script 3) The sort script uses the sort defined in step 1 4) This will not change when you do another manual sort, it will always remeber the sort you did before adding the sort step 5) The only time it will change is if you change something in the script then when prompted, rather than choosing keep current sort, you click replace sort. Now you have your script to do the sort you want, go to EDIT > PREFERENCES > DOCUMENT and set the option - "When opening, perform script" and select your script there. Now every time you open that DB, the sort you did manually in step 1 above, will be performed. Ed.
July 7, 200322 yr 1. Do a Sort 2. Create a script with one step: Sort (restore, no dialog) 3. In the document prefs, set this script to perform when opening. Standard practice among FileMaker developers is to create many Sort scripts, and then attach them to buttons at the top of list layouts. Some of us even do stuff like: If (Status (CurrentModifierKeys) = 1 ) .. Perform Script (Sort - name, ascending) Else .. Perform Script (Sort - name, descending) End If Also... By default sort order, I assume you mean the order when the db is unsorted. This is simply the order in which the records were created. The only way to permanently change it is to sort your records, then export them, delete all records, and import the original (sorted) records. But as soon as you create a new record, you'd have to do it all over again. If your db is single-user, it will in fact remember the last sort. But it won't remember if you're opening a db that's hosted over a network.
July 10, 200322 yr Author That is the problem. My data is over a network. Can I still set it up to single -user, but still have it over the network? I know there is an option in FM Server "Host Single-User Files" Thanks, EvanC
July 10, 200322 yr I have quite a few dbs that have an on open script with a sort. As long as you replace the sort in the script once you have created it (or sort and then create the script), I don't see why there should be any problems.
July 15, 200322 yr Author Hmmm. It still doesn't work. Do you have your files setup as single or multi-user?
July 16, 200322 yr Fitch said: If your db is single-user, it will in fact remember the last sort. But it won't remember if you're opening a db that's hosted over a network. What about using a set of globals and GetField ??
July 16, 200322 yr I think you mean it won't remember the last sort performed once a db is closed. But you can easily set up a sort, create your script with the sort, and set the script to run on open. I do this with several files that are multi-user.
Create an account or sign in to comment