1 Reply Latest reply on Jun 11, 2015 6:05 AM by Fred(CH)

    Erattic behaviour of GetFieldName ( field )

    PeterWagemans

      Summary

      Erattic behaviour of GetFieldName ( field )

      Product

      FileMaker Pro

      Version

      11, 12, 13, 14

      Operating system version

      OSX, Windows

      Description of the issue

      GetFieldName ( field ) also evaluates the field being referred to, while it should only get the field's name.

      Steps to reproduce the problem

      1. Open lab scale file https://dl.dropboxusercontent.com/u/18762341/GetFieldNameBug.fmp7
      2. examine erratic result
      3. convert to fmp12 format
      4. open file

      Expected result

      "abc" in both the .fmp7 file and the .fmp12 file.

      Actual result

      hang crash in .fmp12 file, "abc" and empty in .fmp7 file.

      Exact text of any error message(s) that appear

      none

      Workaround

      None.

      Notes:
      1. FileMaker versions > 11 try to evaluate the fieldcontents as well but crash because they get stuck in a circular calculation ( the calc field is the key to the related field being evaluated ).
      2. GetFieldName() is an essential helper function to soft code the SQL statement in an ExecuteSQL function.

        • 1. Re: Erattic behaviour of GetFieldName ( field )
          Fred(CH)

          It seem there are several confusions on your report and the file provided. Moreover, i am unable to replicate :

                 
          1. The file name extension is actually fmp7 which doen't exist in real life : "fp7" is correct for a FileMaker 11 software, as "fmp12" is for higher versions.
          2.      
          3. Changing the extension to fp7, i am able to open your file with FileMaker Pro 11. However, when i come to the layout named "table1" associated to the table occurrence (TO) of the same name, i do see the field named "key2" displaying only the value "table2 2::field". This result seem absolutely correct, since it is a calculation field, where the formula is : GetFieldName ( table2 2::field ).
          4.      
          5. In the same layout, "abc" is a value of a field named "field" of the related TO named "table2". If you switch to the layout named table2, this value is also displayed in the according field.
          6.      
          7. If i then open the file with FileMaker 14, after conversion, i am not able reproduce any crash. I realize it won't be helpful for you, but you may would to provide additional information about your system configuration, posting again.

           

          Also, keep in mind the following :

          - A table can have many occurrences on the relationship graph, called Table Occurrences (TO).

          - A layout is always associated to a TO, never directly to the table itself.

          - GetFieldName always returns a fully qualified name using following syntax : <TO Name>::<Field Name>.

           

          As a side note, the formula of the field table1::key1 is actually a litteral string : "table2::field", whereas  table1::key2 have the formula i referred previously : GetFieldName ( table2 2::field ). Both calculations are unstored (UC). Note that a relationship based on UC is unidirectionnal, that mean you wont' be able to see related data of table1 from table2.