4 Replies Latest reply on Jan 27, 2016 8:10 PM by DaleLong

    Problem with Filter as you type script and repeating global

    DaleLong

      I've got an issue that appears to be a bug with FileMaker.

       

      I am trying to utilize the relatively popular technique of using a scripted Commit step on an OnObjectModify script trigger, which can be used to perform as-you-type scripting, such as finds or filtering.

       

      The problem is, this technique does not appear to work on a field that is an iteration of a global repeating field other than the first one.

       

      The script is your basic

       

      Set Variable [ $current_object ; Value:  Get ( ActiveLayoutObjectName ) ]

      Commit Records/Requests [ ]

      Go to Object [ Object Name:  $current_object ]

      Set Selection [ Start Position: Length ( Get ( ActiveFieldContents ) ) + 1 ]

       

      If you use this on a global repeating field that is the first iteration, it works fine.

       

      If you use it on a global repeating field that is NOT the first iteration, the script returns a '102 - field is missing' error on the 'Go to Object' step and the cursor jumps out of the entry box.

       

      I've attached a demo file to demonstrate the issue. Go ahead and type in the first iteration, and try to type in the second iteration. Run your debugger, and watch this weird error come up for seemingly no reason.

       

      This is obviously not what should happen. One method of fixing I guess is to not use a repeating field, and just create a separate global field for each filter or screen refreshing field I want to use. But this just really ruffles my feathers, as I have quite a few things built using the global repeating field, and I don't want to go back and undo all of that work just because of this stupid bug. So in the mean time, I was wondering if any of you brilliant folks out there could figure out a workaround to get this basic technique to work with repeating field iterations?

       

      Or do I have to bite the bullet and go back and rewrite a bunch of my code due to this bug?