A READER ASKS: Script Sorting In FileMaker 6

From Dwayne Wright PMP
Certified FileMaker Developer

WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

A READER ASKS
I ran across your site and thought may be able to answer a qucick question. Per the subject, can sort criteria be changed within a Filemaker Pro 6.0 script?

-------
DWAYNE RESPONDS
The FileMaker 7 upgrade continues to be my favorite upgrade to FileMaker (after the all important version 3 upgrade). One of the features in FMP7 allowed was the quick editing of find, sort, print and import/export operations. Here is something I wrote way back in my FileMaker 6 Found Set Guide.

(time machine sound would be great here)

The sort script step along with Finds, Page Setups, Import Orders and Export Orders are one of the oddest parts of ScriptMaker. You have to perform the action before you can get ScriptMaker to remember it. If you want to change the sort order in a script, you have to do the new sort operation, then open the script (as if to edit it), close the script and then choose replace from an upcoming dialog box. The same method is also true for the other settings.

In ScriptMaker, if you need to change the layout destination in a script step, you can choose an alternate layout from the option pull down menu inside of that script step.

If you need to change your sort order in a script step, you need to

- Perform Your New Sort Order
- Open ScriptMaker
- Open The Script You Want To Change
- Close The Script You Want To Change
- Then in the dialog box below, click the Replace radio button next to Sort Setup

If you need to change your page setup in a script step from portrait to landscape mode, you need to

- Go To The Layout
- Change The Page Setup To Landscape Mode
- Open ScriptMaker
- Open The Script You Want To Change
- Close The Script You Want To Change
- Then in the dialog box below, click the Replace radio button next to Page Setup

If you need to change the perform find in a script step, you need to

- Go To The Layout
- Perform The Find
- Open ScriptMaker
- Open The Script You Want To Change
- Close The Script You Want To Change
- Then in the dialog box below, click the Replace radio button next to Find Settings

Also up to and including FileMaker 6, you can only have one effective memorized

sort order
find setting
print setup
import order
export order

step in a script. If you want FileMaker to be able to sort two different ways in the same script ( like in an IF statement branch situation ), one of the memorized sorts will need to be in a subscript.

It is quite possible that some FileMaker solutions out there could benefit from sub scripts such as these ...

Print Setup [ portrait - one record ]
Print Setup [ landscape - one record ]
Print Setup [ portrait - found set ]
Print Setup [ landscape - found set ]
Sort [ order date ascending ]
Sort [ order date descending ]
Find [ date field - today’s date ]
Import [ new orders ]
Export [ shipped orders ]

 

=
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2008 - Dwayne Wright - dwaynewright.com

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.