4 Replies Latest reply on May 21, 2017 12:52 PM by hsutton47

    A Simple Sort Problem - Which I Cannot Solve

    hsutton47

      I wrote a short 5-step script named "Find_OK_only"):

      Here is the Perform Find parameters:

      Here is a snapshot of the Sort parameters:

      And here is where, at the Modify Last Find point, in the layout search form I typed in "WAR" in the TITLE field:

       

       

      And here is the result.  All records with "WAR" in the TITLE field, but not sorted ascending alphabetically by TITLE field:

       

      Notice the red button labeld "sort_test_script".  I click on that and it runs a second script with just the last two steps of the original script.  Running that script successfully sorts the found set:

       

       

      Here is the contents of the 2nd script:

       

       

      I have tried unchecking the 'Keep records in sorted order" just for the fun of it and the exact same results occur.

       

      And when I change the Sort Records {Restore; With dialog:Off] to On, the script does not halt and display the Sort Records dialog box in the original 5-step script.

       

      However, in the "sort_test" 2-line script, if I enable dialog:On for the Sort Records step, the script halts and displays the Sort Records window.

       

      What am I missing here?

        • 1. Re: A Simple Sort Problem - Which I Cannot Solve
          beverly

          Primarily, Modify Last Find puts you into Find mode. You cannot sort in find mode (no found set to sort).

          If you are not changing something after the Modify Last Find, why do you think it should be there?

          Beverly

          • 2. Re: A Simple Sort Problem - Which I Cannot Solve
            hsutton47

            Hello Beverly,

             

            This goes to prove I have not fully grasped the use of (or when to use) Modify Find.  What I am trying to do is have the hard-coded find parameters run but also be able to input what I wish to search for each time in the Title field.

             

            How do I modify the script to incorporate the preset find parameters along with being able to manually type what I want found in the Title field as well?

             

            I was under the impression since I input what I want in the Title field to search on, when the found set of records is displayed that I could then sort the results.    

            • 3. Re: A Simple Sort Problem - Which I Cannot Solve
              beverly

              Modify Last Find

              Pause

               

              This stops until you enter the value(s). Then you must Continue the script when ready.

              If this is not what you want (the Pause), you may consider capturing the values.

               

              But something that you should study first is

              "Constrain found Set"

              FileMaker Pro 15 Help

              &

              (manually):

              FileMaker Pro 15 Help

              You can have your "canned find" performed, then

              Enter Find Mode (pause)

              << enter you criteria manuall>>

              Constrain Find

              Your previous find will be there and your constrained find will use that found set with your new criteria.

              Beverly

              • 4. Re: A Simple Sort Problem - Which I Cannot Solve
                hsutton47

                Oh boy oh boy.  I actually reversed the logic flow.  First, I enter into find mode pausing to input my Title, then use the Constrain Found Set with the stacked hard-coded parameters.  Now the sort records works fine.

                 

                 

                Thanks Beverly!