Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting by Column 1

Status
Not open for further replies.

mattpacman

IS-IT--Management
Nov 14, 2002
6
0
0
US
I am still having some trouble writing a script to sort by column. I tried the method suggested by Chris, and have set up my script in the following way:

Go To Field ["PayDueDate"]
Sort [No Dialog]

However, I receive an error message that says:

"The previous script step "Sort" could not be completed because it restores an invalid request. Do you wish to continue with this script?"

Option buttons are "Cancel" and "Continue".
I am running FMP 5.5 for Mac.

Am I doing something wrong or does anyone know another way to use sort by column buttons?

Thanks in advance,
Matt
 
Hi Matt,

When you created the script for the sort, did you perform the sort manually first?

Since you already have the script created - try this;

- Go to the layout that you want to view the sorted results on.

- Set your parameters and manually perform the sort (by PayDueDate

- Open your script and then hit OK. It will prompt you about keeping the current saved parameters for the sort or replacing the parameters with the last sort you performed. Select REPLACE and click OK.

This should reset your script so it will sort by that field. If you want to sort by a different column, create a new script using that sort.

The script will hold one set of parameters - just like the print setup.

HTH Im Steven B
 
Matt:
I don't think you have the basic understanding of scripting a sort. You think that a script that "goes to a field" and then calls "Sort" should do it. But Filemaker is not that logical, and its use of Sorts in scripts is one of its lamest features.

Here's how you create a sort script:

FIRST: Perform the actual sort you want while in Browse mode. THEN create your script (or edit the existing one, but let's say you're creating a new one). Create a new script, put in the Sort script step. Check the "Restore Sort Order" (THAT's what makes the script re-do the manual sorting you started with) and -presumably - the "no dialog" options.

That's all - no "go to field" necessary at all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top