7 Replies Latest reply on Sep 10, 2014 2:19 PM by PamelaSnyder

    Scripting question



      Scripting question


      I am putting together a small script.  

      I have specified a layout, sort, print.  That works fine.

      Now I would like to return to the original sort and omit a subset of records.  How do I specify to return to the original search and omit records with a value "B" in a specific field?  I tried

      Modify Last Find

      Insert Text

      That gets me back to the original find - and enters the text I want - but i don't know what command to use to specific that the request is an omit - or how to initiate the find (perform find brings up a new request).


        • 1. Re: Scripting question

          Constrain Found Set will enable you to 'filter' out your 'B' records

          this script step gives you the option to Find or Omit records based on criteria you specify - and note that you can use a number of requests in this script step

          • 2. Re: Scripting question

            You can never be sure of the current FoundSet. A user can have omitted one or more records, made a new one, changed the sort order, etc.

            To be sure to keep the current situation you can do your other stuff in a new window. After finishing the print-job you simply close this window. Everything in the other window is exactly as you left it.

            • 3. Re: Scripting question

              Thank you symbister!  I never would have figured it out.

              hbrendel - thanks for the warning on the found set - luckily we have a very small number of users - but it is good to keep in mind.

              • 4. Re: Scripting question

                I have been working on this script and I was able to get pretty far towards my goal.  

                There is a manual find of a date range before initiating the script.  the Modify last find refers me back to that nicely - then I constrain the found set and take it to a summary layout and print.

                I am wanting to to back to the ORIGINAL MANUAL find when I extend the found set again at the first "HERE" in my image.  I thought it was working when I was testing the script because it was giving me back the original found set - but I found that when I change my initial Manual search - the "test" date range is now hard wired into my script.  

                Is there a way to refer back to my manual search after the Constrain Found Set (where records are omitted)? 

                Is there relatively easy way to make the entry of the date range part of the script - so there would be parameters to refer back to?  

                Thank you so much for the help - 

                Is it ok to ask another question on this thread - or should I have started a new thread?  

                • 5. Re: Scripting question

                  suggest that you check hbrendel's response - opening a new window and running a find within that window retains that found set within that window - and you can have several windows open - just starts getting to tricky to open/close the right ones

                  to answer the other question re date range, suggest you set up two fields in your table, defined as global storage, say 'gstart_date' and 'gend_date' both type date, then you can use these as input fields in a Custom Dialog script step to conduct your first search using these fields as parameters

                  • 6. Re: Scripting question

                    On windows systems, opening additional windows can result in undesirable side affects--either a rather awful window inside of a window and the original window might spontaneously drop out of maximized state and resize to a very unexpected and undesirable set of dimensions. Minimizing these affects are possible, but the result is still less than ideal.

                    You can also open Manage | Database | Relationship and duplicate the table occurrence of the table you are searching. If you perform a find on a layout that specifies this new table occurrence in Layout setup, you are finding the same record, but the layout's found set, sort order, etc will be independent of your current layout. (In some cases this would require duplicating a group of table occurrences if the layout in related tables such as a portal.)

                    Caulkins Consulting, Home of Adventures In FileMaking

                    • 7. Re: Scripting question

                      You and hbrendel were absolutely correct.  A new window solved my problems.  Can't thank you enough.  Now I can save the Custom Dialog script lesson for another day.

                      I am just starting to work with Filemaker12 and can be very blind to the tools at my disposal.