2 Replies Latest reply on Dec 20, 2011 10:22 AM by tech_liaison

    Create Field Names with a Calculation

    gawendt

      I am working on a table that has multple markets (up to six) in a given state. Originally, I set the Market field to have 6 repetitions but I found I can not find in which repetition a given market exists as a find will return positive found status if the market name is in any of the six repetitions. So I tried to created six fields called Market1, Market2 ... Market6. I can't figure out how to get the 'Set Field by Name' scripting step to create the field name by adding a counting variable to the end of the word 'Market' as it wants the calculated field to be surrounded by quotes. Is there an other way or am I doomed to a big 'if' statement. Thanks for your help!!

       

      Greg Wendt

        • 1. Re: Create Field Names with a Calculation
          paulspafford

          Hey Greg,

           

          You should create a related table to hold the market names. Repeating fields and numbered fields (Market1, Market2, etc.) have too many limits, and require a lot of work-arounds.

           

          I did a blog post about creating a related table a while back:

          <http://fmlayoutmode.com/wp/?p=2020>

           

          Once you've done this type of setup, you can just do a find in the related field, and it will search across all of the markets. There's also some good stuff in the manual that came with your copy of FileMaker, and pretty much any FileMaker book you can find.

           

          Paul

           

           

           

          --

          Paul Spafford

          FileMaker Database Superhero,

          Spafford Data Solutions

           

          Tel: 613 838 9956

          www.paulspafford.com

          www.ottawafilemakerdeveloper.com

          www.fmlayoutmode.com

          www.fmscripts.com

           

          FileMaker User Group in Ottawa:

          www.meetup.com/fudgeo

          1 of 1 people found this helpful
          • 2. Re: Create Field Names with a Calculation
            tech_liaison

            Hi Greg: Paul is certainly correct about using a related table for this rather than trying to fit every combination of all your fields into a single table. However, to answer your specific question about Set Field by Name: are you using the fully qualified field name, which includes the table name like so?

             

            Set Field by Name [ "table_name::field_name"; $new_value ]

             

            It's not going to work without the table name. There are some great usage examples in FileMaker Pro Help, including an example of using a variable to supply the field name. HTH.

             

            Best,

            Dave

            1 of 1 people found this helpful