2 Replies Latest reply on Mar 20, 2012 2:27 PM by Stephen Huston

    assistance with appropriate script

      Dear Group


      I have a script which reads the following:


      #Add new record in respective HPI field.


      If [Get ( ScriptParameter ) = "sym"]

      If [not IsEmpty ( sym ) and IsEmpty (HPI)]

      Set Field [HPI; sym]

      End If


      End If


      Here is the question: Suppose the field is allowed to have a maximum of 15 repetitions; how should that script above be written to ensure that all repetitions (and not just the first entry) are added as a new record?

        • 1. Re: assistance with appropriate script

          You have 14 too many repetitions.   Think about using a related field to store this data.

          • 2. Re: assistance with appropriate script
            Stephen Huston

            In addition to 14-too-many repetitions, you have an infinite shortage of repetitions if there is any chance on earth (there always is) that 15 wouldn't be enough to handle all possible future needs.


            Rhlilienkamp is right, going with a related record system solves both the too-many and too-few reps issue.


            Use repeating fields  only when you both already know exactly how many reps you must have and a related field won't work. Repeating fields have some proper uses, but all too often they are used because the relational data model is being compromised.


            (Historically, FileMaker went through an early phase where repetitions were available but true related records weren't yet supported, and repeating fields still get used in that way, but they shouldn't.)