11 Replies Latest reply on Nov 30, 2009 7:14 PM by RSchaub

    Repeating Field Bugs



      Repeating Field Bugs

      Description of the issue

      Using versions 9 or 10, If you have the repeating fields laod out in singular form,Meaning 1 to 1 , 2 to 2 and so on the command Go To Field [Repeating] [Rep#] Does not work. In versions 9 or below using the zippscript plugin for script triggers, and a custom functionI am able to get the highest rep number with data in it. setting a global varible to that numberI can then use Go To Field [Repeating] [$$Variable +1] This script trigger works great, always after validating the entry it will go to the next empty repunless all reps are full.... This is OK No Problem However using the same idea with FM10 and its built in script triggers (Which I think is the zippscriptbecause it disapeared of the face of the map when 10 was released) Anyway If I use the Go To  Field anda $$Varible for the rep# it throws the script into a loop and will not stop until pressing the escape button Take that old zippscript plugin and use it in 10 as I did with 9 it works. 

        • 1. Re: Repeating Field Bugs



          Thank you for your post.


          I am unable to replicate the problem.  This is what I have done....


          I created a table with two fields:


          Name (Text)

          Repeat (Text - 10 repetitions)


          On the layout, I displayed 10 separate fields of "Repeat", each belonging to a specific repetition (1 through 10).


          I created the following script:


          Set Variable [ $var ; <formula below> ]

          Go to Field [ Repeat [ $var ] ]



          Case ( IsEmpty ( GetRepetition ( Repeat ; 1 ) ) ; 1 ;

             IsEmpty ( GetRepetition ( Repeat ; 2 ) ) ; 2 ;

             IsEmpty ( GetRepetition ( Repeat ; 3 ) ) ; 3 ;

             IsEmpty ( GetRepetition ( Repeat ; 4 ) ) ; 4 ;

             IsEmpty ( GetRepetition ( Repeat ; 5 ) ) ; 5 ;

             IsEmpty ( GetRepetition ( Repeat ; 6 ) ) ; 6 ;

             IsEmpty ( GetRepetition ( Repeat ; 7 ) ) ; 7 ;

             IsEmpty ( GetRepetition ( Repeat ; 8 ) ) ; 8 ;

             IsEmpty ( GetRepetition ( Repeat ; 9 ) ) ; 9 ;

             10 )


          When I create a record and add data to Repeat, when I execute the script, my cursor is in the first available empty space.  If there is data in every repetition, the cursor is placed in the tenth repetition.


          I'm not sure what else to try here, so please post your script and I'll try to replicate it here.



          FileMaker, Inc. 

          • 2. Re: Repeating Field Bugs

            Not Quite... Although you have a nice work around. Don't be so quick to say

            Solution or Solved.


            What I am pointing out as a bug is without a work around such as your

            suggestion If a number (let's say it is 8) is loaded into a varible


            and the fields are laid out separately.. The Go To Field ; Repeating ; $varible does not work NOR

            doe in a script GO TO Field [Repeating;8] does not work.


            You should not need a work around , this is version 9 and 10 , these bugs should have

            been ironed out in the version update when we were first able to layout repeaters separatly.

            • 3. Re: Repeating Field Bugs



              Sorry for the misunderstanding.  I never said it was a solution.  I just said I was unable to replicate the problem, and I provided the steps I tried.


              On my layout, I had 11 different fields.  Name and one field for each repetition of "Repeat".  Go To Field specifying Repeat with $var works correctly for me in my script.


              Again, let me see your script, and I'll try to replicate the problem here.



              FileMaker, Inc. 

              • 4. Re: Repeating Field Bugs

                It looks like there may be a syntax issue here


                The correct form for using Go To Field to place the cursor in a specific repetition of a repeating field should look like this in your script editor:


                Go To Field [YourTable::yourRepeatingField; [$RepetitionVariable]]


                Note the presence of an extra pair of [] and the name of your field's table which are both missing from your example.



                • 5. Re: Repeating Field Bugs

                  Phil  - Sorry I did not type it in perfect ... But that is what I have. It is a script step

                   Script =



                  Commit Records/Requests

                  Set Variable [ $$LastRep; Value:LastRepNumber ( Duplicates Across Muliple Fields::FieldRep;10 ) + 1]

                  Go to Field [ Duplicates Across Muliple Fields::FieldRep[$$LastRep] ]

                  [ Select/perform ]


                  The idea is to not only have unique records in this repeater but also unique data inside the field itself

                  I have a custom function that tells me what the highest repetition with data.

                  I then set the varible to that plus 1

                  then the GO To field  as seen above, It does not matter if it is if the varible is local or global

                  when the fields are set up sinugar , one rep at a time the go to statement does does work.


                  Even if I use one a single line

                  Go to Field [ Duplicates Across Muliple Fields::FieldRep[5] ]  this do not work either


                  However when I layout the fields the old fashined way it works like a charm.


                  I will put toegether a small sample later and a download link.




                  • 6. Re: Repeating Field Bugs

                    Thanks for the clarification. Reproducing a single script step can be a pain. I see in my own example where I've included an extra ; that should not be there.


                    I tried the following test script both with and without the pauses:


                    Set Variable [ $$rep; Value:1 ]

                    Go to Field [ RepeatingFields::Field[$$Rep] ]

                    Pause/Resume Script [ Indefinitely ]

                    Insert Text [ “Testing” ] [ Select ]

                    Set Variable [ $$rep; Value:$$rep + 1 ]

                    Go to Field [ RepeatingFields::Field[$$Rep] ]

                    Pause/Resume Script [ Indefinitely ]

                    Insert Text [ “One” ] [ Select ]

                    Set Variable [ $$rep; Value:$$rep + 1 ]

                    Go to Field [ RepeatingFields::Field[$$Rep] ]

                    Pause/Resume Script [ Indefinitely ]

                    Insert Text [ “Two” ] [ Select ]


                    Three instances of the same field with 1 to 1, 2 to 2, 3 to 3 were created on the current layout and the script ran perfectly both times.


                    Try a simple new test database with just the one repeating field and see if it works for you. If so there may be a problem with your file.

                    Check to see if your global variable really gets the correct value. If you have advanced, you might want to step through the script with the debugger and data viewer to see what happens.

                    • 7. Re: Repeating Field Bugs

                      Thanks Phil,


                      All I am trying to do is point out a bug, That is what this forum is for correct.

                      I know your work around will work as well as TSGal's as seen above.


                      I am pointing out that particular statement does not work stand alone as it it

                      does when the fields are laid out the old fashioned way.


                      In my opinion that is a bug... If I use  

                      Go to Field [ Duplicates Across Muliple Fields::FieldRep[5] ] it should go to the

                      rep in the layout 5 of 5 as it does the old way.


                      Thanks for the input. But after 15 years of doing this , kinda getting tied of'

                      work arounds for something that should be one simple line iten in a script.


                      • 8. Re: Repeating Field Bugs

                        This is not a work around, it is an attempt to reproduce the behavior you have reported. In what way is it different from yours?


                        In your example, you use Go to Field [ Duplicates Across Muliple Fields::FieldRep[$$LastRep] ] [ Select/perform ]


                        When I use Go to Field [ RepeatingFields::Field[$$Rep] ] [ Select/perform ]


                        I am using exactly the same step with exactly the same options/parameters and do not experience any problems.


                        How does my example differ from yours?

                        • 9. Re: Repeating Field Bugs

                          Maybe my file is corupt or something... I just tried TSGal solutuion in a new script and it does not

                          work either. The data viewer shows the Varible to be the number 9 which is correct.

                          However the cursor is not in the field.


                          • 10. Re: Repeating Field Bugs

                            A simple test:


                            Recover the file.

                            Test the recovered copy (even if it reports "no problems found".)

                            If the recovered copy works correctly, toss it and use an undamaged back up copy of the file if at all possible.

                            • 11. Re: Repeating Field Bugs

                              OK I give up... I finally get it to work with a script trigger and it works good..

                              Until you start flipping between records seems once it is committed the script trigger

                              does not work.


                              Ya it goes to the field it is supposed to... but after a second or two in the field

                              the cursor vanishes.


                              In 9 using zippscript it does not work at all, even If I run the script manually it does not work.


                              on another machine with 10 after committing the script triggers are dead.

                              However the manual script works.


                              This started out by what I thought was a pretty simple task.

                              Unique Repeating fields, including unique at record level also.

                              To do this the record must be commited, because of the validation

                              If the user adds a duplicate say in the 7 th rep the validation

                              gives a choice of revert record or the second message will be reverd field

                              If not committed and revert record is chosen it will erase all data enter in all previous 7 reps.


                              I had it working ,... and then poof script triggers no longer work.


                              Even after from starting a new file from scratch.


                              I raise my hands and walk away from this.