3 Replies Latest reply on Nov 4, 2016 3:27 PM by philmodjunk

    Reason to duplicate fields?

    amerritt

      I'm taking over maintenance on a filemaker project and ran across an interesting field setup in a table.

      There are fields like "2016 leader" and "2016_leader" where the first is a text field and the second is a calculation.

      The definition of 2016_leader is "${2016 leader}.

      Both are referenced in various scripts on this project.

       

      Is there any reason why I can't combine those and have the scripts simply use 2016 leader all the time?

       

      I can't think of any advantage to doing this.

        • 1. Re: Reason to duplicate fields?
          philmodjunk

          2016_leader is the better field name. You won't need the ${} notation in any calculations that refer to it.

           

          Sometimes a calculation field is used to display the data while preventing users from modifying it.

           

          So so you will need to take at least that second detail in mind as you replace the one field with the other.

          • 2. Re: Reason to duplicate fields?
            amerritt

            That is probably the exact reason for the duplicated fields. It makes sense in this situation.

             

            But as far as scripting, either field could be used interchangeably right?

             

            Thanks philmodjunk, I knew I could count on you.

            • 3. Re: Reason to duplicate fields?
              philmodjunk

              That would depend on the script.

               

              If your script tries to modify data in that field, it will fail and generate an error code if the field it attempts to modify is of type calculation.

               

              There are a number of methods for displaying data in a field without allowing it to be modifiable, so you may find that you can make some layout changes and then no longer need the calculation field. Merge fields are not editable. You can remove browse mode access to a field in the Inspector on the "data" tab to name two alternatives.

               

              The calculation method is no longer needed except to make two particular operations possible: Formatting the field with a scroll bar that the user scrolls in order to read all the text in the field and making the data something that they can copy to the clipboard (or select and drag and drop from) while in browse mode.