AnsweredAssumed Answered

Sorting Find Results in Multiple Ways

Question asked by MelissaKreindel on May 17, 2012
Latest reply on May 25, 2012 by philmodjunk

Title

Sorting Find Results in Multiple Ways

Post

I created a Find script which takes me to a result page in List form. I have it automatically sorting these records by Last Name. However, I also want the option to sort them by 3 other fields as well (a date, a category, and a company). I tried to copy one of the template sorting scripts but for some reason, it won't sort ALL of the list. I created a Sort Selection and a Sort List Key fields but they don't seem to be working like the template, because those fields, when not hidden, display different things for each record. In the Options for the Sort Selection Field, I have auto-enter a calculation: If ( IsEmpty ( Self ) ; "Last Name" ; Self ). The Sort List Key is a calculation: GetField ( Sort Selection ). Any help would be GREATLY appreciated as I am very new to FIlemaker! Thanks!!

This is the script I am currently using:

If [$$SCRIPT_TRIGGER = "Off"]

   Set Variable [$$SCRIPT_TRIGGER; Value:"On"]

   Exit Script []

End If

Set Variable [$$FIND_SIMILAR; Value:""]

If [ipot1::Sort Selection = "Last Name"]

   Sort Records [Restore; No dialog]    ---> Here I specified sort order by Last Name

Else

   Sort Records [Restore; No dialog]    ---> Here I specified sort order by Sort List Key and under Last Name

End If

Go to Record/Request/Page [First]

Outcomes