3 Replies Latest reply on Nov 25, 2012 8:29 AM by philmodjunk

    AUTO-ENTERING VALUES BASED ON LAST RECORD

    MaxwellRobin

      Title

      AUTO-ENTERING VALUES BASED ON LAST RECORD

      Post

           Hi All!

           i have a table that tracks spot light movements and changes for theatrical productinons.

           there are 8 "spots" across the layout and each new record goes down as time progresses in sequence

           i am trying to create a script that can see what is entered in the last field and then make a decision to auto enter another piece of text depending on what the previous value is. i can send more information and images if this is pausible.

           thank you!

        • 1. Re: AUTO-ENTERING VALUES BASED ON LAST RECORD
          philmodjunk

               There are auto-enter calculations that can do this--no script needed.

               GetNthRecord can be used to refer to a value in the previous field:

               If ( Get ( RecordNumber ) > 1 ; GetNthRecord ( FieldName ; Get ( RecordNumber ) - 1 ) )

          • 2. Re: AUTO-ENTERING VALUES BASED ON LAST RECORD
            MaxwellRobin

                 so it looks like this should work but i just want to be a little more clear to make sure of it.

                 here is an example:

                 the first record has "Full" in the Spots::Action field

                 when i create the next record it auto enters "Maintain" into the Spots::Action field

                 when i create the next record it auto enters "Maintain" into the Spots::Action field

                 if i change "Maintain" in this third record to "Fade Out"

                 when i create the next record it auto enters "Off" into the Spots::Action field

                  

                 will this still work?

                 there are some more combinations like this but this is one example

                  

                 thank you!

            • 3. Re: AUTO-ENTERING VALUES BASED ON LAST RECORD
              philmodjunk

                   It should, as long as each new record appears after the previous record in the found set. There are specified sort - order, auto-enter combinations that can result in new records appearing elsewhere in the found set--such as the very first record. But with unsorted records, this should not be an issue.