3 Replies Latest reply on Jan 7, 2015 10:06 AM by philmodjunk

    FielNames function: bug?

    argasoft

      Title

      FielNames function: bug?

      Post

      Hi!

      Help says: "Returns a list of the names of all fields on layoutName, in fileName file, separated by carriage returns".

      Well, to me it gives a list of *all* the fields in the FormatTable (just the name, no "Table::") *and* all the fileds establishing a relation (this as TableName::FieldName).

      Suppose that with "fileName file" the entire file (i.e. name.fp*) is intended and not the table.

      Extra-fields listed are *not* on the layout.

      Thanks for any advice.

      Arnaldo

        • 1. Re: FielNames function: bug?
          philmodjunk

          I used the dataviewer Fin FileMaker Advanced 13.04 on a Windows 7 system to run a test on one of my files.

          FieldNames ( Get ( FileName ) ; Get ( LayoutName ) )

          Returned the following list from the current layout visible in this file:

          __pkTutorialID
          TutorialTitle
          TutorialUrl
          Intro
          CopyField
          GlobalFields::gSaveClipboardData
          GlobalFields::gSaveClipboardGraphic
          Keywords
          GlobalFields::gSelectKeyWord
          Template
          cMessage
          GlobalFields::gCharacter
          gSignatureIDKey

          This is exactly the fields present on this layout. The fields that start with GlobalFIelds:: are fields from a different table occurrence than that specified for the current layout. This included fields that I "hid" by putting them to the right of the layout boundary.

          I then made a copy of the layout, deleted some fields from the layout and tested the function again. I got:

          GlobalFields::gSaveClipboardData
          GlobalFields::gSaveClipboardGraphic
          Keywords
          GlobalFields::gSelectKeyWord
          Template
          cMessage
          GlobalFields::gCharacter
          gSignatureIDKey

          The difference in this list corresponds exactly with the fields that I removed from the layout. (But this change only appeared once I saved my changes to the layout...)

          • 2. Re: FielNames function: bug?
            argasoft

            Thanks, Phil.

            The fields on the layout have always been 7 and not 20 (= number of fields in the table and listed with the function) and has not changed between the various viewings with the debugger (I also closed FM -> restarted -> viewed = same "error") and no hidden fields on the layout or empty web-viewer.
            I just have 02 popover calls with 06 fields (global, 04 + 02) in the same table as the layout one. So "13" should be the maximum of fields listed, I guess.

             

            Strange enough:
            - if I use WordCount the result is 22, as "::" is considered a "word limiter", so "Table::Field" are for FM two words here
            - if I use ValueCount the result is 14, i.e. 20 (fields in the table) - 06 (global_fields in the table), although still 22 listed (=20 fields in the table + 02 related fields).

            I use FM13.03 - Win7 64Pro SP1 - DB size 3.12Mb no external sources called - Xenon 3.07 GHz - 8,0 Gb RAM

            Thanks again

            Arnaldo

            • 3. Re: FielNames function: bug?
              philmodjunk

              ValueCount Should return the exact number of fields placed on the layout specified in the FieldNames function.

              Please note that it is very easy to have fields on a layout that are either not visible--even in layout mode or easily over looked.

              You can, for example, size a field to be 1 pixel high and 1 pixel wide. You can also place a field behind an opague object on the layout--just to name two possible ways that you might overlook the fact that a field is actually present on your layout.