FMPRO-L Archives

November 2011, Week 1

FMPRO-L@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Mime-Version:
1.0
Content-Type:
text/plain; charset="UTF-8"
Date:
Mon, 7 Nov 2011 15:11:36 -0500
Reply-To:
FileMaker Pro Discussions <[log in to unmask]>
Subject:
Content-Transfer-Encoding:
quoted-printable
Message-ID:
Sender:
FileMaker Pro Discussions <[log in to unmask]>
From:
John French <[log in to unmask]>
Parts/Attachments:
text/plain (29 lines)
iMac (27-inch, late 2009), Mac OS X 10.6.8, FileMaker Pro Advanced 11.0v4

I have a well-behaved database that, for purposes of this description, consists of a Name field (Text type) and a Date field (Date type). There are two layouts, Standard and Search. I wish to create a script that changes to the Search layout, waits for me to enter something in the Name field, conducts a Find on the Name entry, and sorts the found set by the Date field in descending order (youngest first).

No matter how I try to go about this, I always end up in the Search layout, with the proper found set, but sorted in ascending (eldest first) date order, which is the order in which the records were entered.

I've tried building all the steps into a master script:

     Go to Layout ["Search" (database name)]
     Enter Find Mode []
     Sort Records []

I've tried building each step into a separate script and then referencing each script, in turn, from a master script:

     Perform Script ["Go to Search layout"]
     Perform Script ["Find Name"]
     Perform Script ["Sort by descending date"]

I've tried explicitly sorting in descending date order before performing the master script.

In every case, the result is the same--a properly found set but sorted in order of record entry (ascending). Once that result appears, if I execute the standalone "Sort by descending date" script (or explicitly perform the sort operation), the order becomes as I wish it to be. I just can't find the way to have the sort accomplished as part of a single scripted procedure. I always have to follow up with a separate, seemingly superfluous sort operation.

If I perform each of the steps separately, either explicitly or embedded in single-step scripts, the end result is what I want it to be. Only if I invoke the process through a single script does the sort appear not to take place.

I've got a feeling that all this does is reveal my rudimentary, inadequate understanding of FileMaker scripting; but, for the life of me, I can not figure out what I must be overlooking. Any help out there?

Thanks,
John French

ATOM RSS1 RSS2