4 Replies Latest reply on Jul 1, 2016 1:40 PM by keycrew

    Script: View records dated one day after currently viewed records

    keycrew

      I have been trying to write a script that allows one to modify a found set of records, (ie a list of records on a certain date), to show records on the next calendar date (advance one date). So I can 'view the same layout with tomorrows records.

       

      Then a separate (but similar?) script to show ALL records after 'today's date, (every record into the future).

       

      I'm having a hard time wrapping my head around how to do this. I've been working with 'GetField (Main Base::Date) + 1' for the 'advance to next date' script, but cannot get it to work. It seems like it should be simple. Am I over thinking this? Any clues for me?

       

      Thanks

      M

        • 1. Re: Script: View records dated one day after currently viewed records
          siplus

          you need a global field of type date, let's call it gReferenceDate. Put it on your layout and attach a onModify script to it. The script will do a search for your records with that date.

           

          Create 2 buttons, one with + and one with ++ on it.

           

          The + one will increment gReferenceDate with 1 and call the find script.

          The ++ one will leave gReferenceDate as it is but will call a different script, one that finds records with date > gReferenceDate.

           

          The 2 scripts can be combined in one and have a parameter defining the kind of find that the script is expected to perform.

          1 of 1 people found this helpful
          • 2. Re: Script: View records dated one day after currently viewed records
            keycrew

            Thank you for your speedy response. I intuitively understand what you're suggesting (very clever by the way), and have begun to implement it. I feel however, that I'm missing certain elements of this procedure.

             

            1) you need a global field of type date, let's call it gReferenceDate. Put it on your layout (done and done)

            2) attach a onModify script to it. (done)

            3) The script will do a search for your records with that date. <-- I'm having trouble with this. How is the date entered into this field (manually)? Can I have this field auto filled with the date of the currently viewed records?         

            4) Create 2 buttons, one with + and one with ++ on it. (done)

            5) The + one will increment gReferenceDate with 1 and call the find script. (this is using another script, right?)

            6) The ++ one will leave gReferenceDate as it is but will call a different script, one that finds records with date > gReferenceDate.

             

            The 2 scripts can be combined in one and have a parameter defining the kind of find that the script is expected to perform.

            • 4. Re: Script: View records dated one day after currently viewed records
              keycrew

              Incredible! Thank you so much!