3 Replies Latest reply on Feb 4, 2014 9:33 PM by philmodjunk

    Moving data (of repeating fields) to next line

    R12GS

      Title

      Moving data (of repeating fields) to next line

      Post

           I am using script variables to log 'now' conditions.  We are not keeping the data, it's just so the sales manager can see if his guys are taking care of business.  I have composed a $variable to put it in line 1 and this works well.  But now he wants to keep a few of the "old" so he can see progress.  It seems this might be a decent use of a 'repeating field' because I already have the field.  I will show him 3 lines to start, maybe he will want a longer history up to 5 lines.

           My idea is to use a repeating field.   Each time line1 is updated, 

           1) Move Line2 into Line3

           2) Move Line1 into Line2

           3) Get new data for line1

           This seems fairly simple, can anyone offer hints or a similar example of scripting to get started? What I'm having trouble with is moving the lines in the repeating field.

        • 1. Re: Moving data (of repeating fields) to next line
          philmodjunk

               A much better idea will be to use a portal to a related table where "moving to the next line" is simply a case of adding a new related record to the portal. The same script might delete the oldest record from the top of the portal and add a new record to the bottom of the portal.

          • 2. Re: Moving data (of repeating fields) to next line
            R12GS

                 Thx for help,  Have had problems in the past with repeating fields vs discrete records, so I understand it's a better way.

                 But dang ….   I will have to learn some more things to do it that way, or pay somebody if i can't figure it out.  Database structure has gone thru a big change last year and I'm not quite sure how to do that with the new structure.   Plus I can't do it with a live database.

                 The reason I wanted to use the repeating fields is I would be done in 10 minutes…..  (taking the easy way out.) 

                 Is there no simple way to do it with repeating fields?  If I can just do it with script steps and $variables I can do it on a live database.

            • 3. Re: Moving data (of repeating fields) to next line
              philmodjunk
                   

                        Database structure has gone thru a big change last year

                   Ummm, but what I am describing is not new. It's basically the same structure and method that I would have used with FileMaker 3. Related tables of records and portals have been a standard part of FileMaker since then.

                   And it's just about as easy to set up as a repeating field--and much simpler as well as more flexible in the long run for this type of thing.