3 Replies Latest reply on May 7, 2012 2:11 PM by timwhisenant

    auto increment global with changing original value

    ian.moree

      How would i auto-increment a value using a global field or global variable;

       

      given i have a start_Date = "5/14/2012"; and this is my first portal entry:

       

      g_start_Date(5/14/2012) :: 9am | 5pm | 8 hours

      ------------------ end of portal row 1 & new TimeEntry field --------

      g_start_Date( auto increment from 5/14/2012) + 1

      g_start_Date( 5/15/2012) :: 10am | 4:30pm | 6.5 hours

       

       

      I hope someone can explain to me how to do this.

       

      -i

        • 1. Re: auto increment global with changing original value
          beverly

          ian, for these kinds of things, I like to write out on paper or in a text editor. write out everything that you want as result. or at least write out enough to allow you to figure out the math between the entries.

           

          1. what are you incrementing (days? hours? minutes? ??)

          2. write out the formula that you would manually use to increment between each pair of entries (first and second, second and third, etc.)

          3. see if there is a pattern that would allow you to translate to FileMaker functions.

          4. do you have a variable start for a range?

          5. do you have a variable end for a range?

           

          6. how would you do this in other programming or scripts (non-FileMaker)?

           

          If you can answer these, perhaps a custom function could be written to do this in Filemaker.

          Beverly

          • 2. Re: auto increment global with changing original value
            ian.moree

            thanks Beverly;

             

            putting all the pieces together is like solving a giant puzzle.

             

            Cheers for you help.

             

            • 3. Re: auto increment global with changing original value
              timwhisenant

              Try

               

               

               

              Case( Get(PortalRowNumber) > 1; GetNthRecord( g_start_Date; -1) +1; start_Date)

               

               

               

              This will work when the records are in a portal. Set it as an auto enter calculation for the date field.

               

              I’m not really sure what you would use this for.

               

               

               

              Tim