1 Reply Latest reply on Aug 6, 2012 10:26 AM by philmodjunk

    Updating dates in scripts



      Updating dates in scripts


      I have been using FileMaker Pro Advanced  (currently using version 11), but I am not a certified developer.  Consequently, I do get bogged down with some routines that probably could be done easier if I knew more. 


      I’m wondering if there is a faster method of changing the dates in a script, such as the one below.  Currently, I am going into multiple scripts like this, double clicking each line, the “edit find request” dialogue box appears, and then I change the criteria, and save the change.  I do copy and paste the date to save some time, but it’s extremely repetitive.  Is there a way to combine the fields (SS.1, SS.2, SS.3, etc.) into a unit and list the criteria (date) just once.  Basically, my query is to find if SS.1 equals the date 5.18.2013 OR if any of the other fields equal 5.18.2013.  Each year, I need to change the date, and I'd like to make this process less time consuming.




      Specify Find Requests

      Action                        Criteria


      Find Records          Tardy Database::SS.1: [5/18/2013]

      Find Records          Tardy Database::SS.2: [5/18/2013]

      Find Records          Tardy Database::SS.3: [5/18/2013]

      Find Records          Tardy Database::SS.4: [5/18/2013]

      Find Records          Tardy Database::SS.5: [5/18/2013]

      Find Records          Tardy Database::SS.6: [5/18/2013]

      Find Records          Tardy Database::SS.7: [5/18/2013]

      Find Records          Tardy Database::SS.8: [5/18/2013]

      Find Records          Tardy Database::SS.9: [5/18/2013]

      Find Records          Tardy Database::SS.10: [5/18/2013]

      Find Records          Tardy Database::SS.11: [5/18/2013]

      Find Records          Tardy Database::SS.12: [5/18/2013]

      Find Records          Tardy Database::SS.13: [5/18/2013]

      Find Records          Tardy Database::SS.14: [5/18/2013]

      Find Records          Tardy Database::SS.15: [5/18/2013]

      Etc. for about 30 different fields

        • 1. Re: Updating dates in scripts

          You have two different issues here.

          The major issue is the "about 30 different fields" that should be just one field but in about 30 different related records. Not only will this simplify your find requests by allowing you to specify a date in just one field, it will simplify many other issues with your database and be much more flexible.

          The secondary issue is using a script to find your records that uses criteria specified by the user.

          You can have the user enter a date into a global date field and then a script can use the date in the global field to set up search criteria and perform the find:

          Say you set up Globals::gDate as the field to use for this purpose:

          Then a script might look like this:

          Enter Find Mode []
          Set Field [TardyRecords::DateTardy ; Globals::gDate ]
          Set Error Capture [on]
          Perform Find []