6 Replies Latest reply on Sep 27, 2011 10:45 AM by kj121

    Fieldnames function problem



      Fieldnames function problem


      FileMaker Pro



      Operating system version

      OS X.5.8

      Description of the issue

      We run filemaker server 11.3 on a Mac OS server 10.5.8. Filemaker server is up to date.

      My personal computer is running X.6.8. I made a db solution using script triggers and functions. On my computer it all works just as we want. I uploaded this onto the server and it is not working. It seems that the function not working is

      FieldNames ( Get (FileName); "SearchFields" )

      Even if I hard code the Filename it does not work.

      I spent some time on this because I thought it must have been something I did but have proved that this is so. The db not working on the server works when I copy it and put it on my desktop.

      Steps to reproduce the problem

      Downloaded searchfilter form here as the sample:


      Works on my computer, works when uploaded onto server.

      Yet mine behaves the same way. Works on my computer (Filemaker 11.4)
      Does not work hosted by server 11.3.

      I know this means I must be blind but I have looked and looked, saved a compacted copy and on and on.

      Expected result

      To see a list of field names

      Actual result

      an empty box


        • 1. Re: Fieldnames function problem

          Solved this. Typically I copy a db to the server then upload it from the server interface.

          I deleted that db from the server. Then I uploaded to the server the working db sitting on my personal computer desktop and it all works.

          Cannot explain it but that is what happened.


          • 2. Re: Fieldnames function problem

            I'm curious, what method are you using to move the results of the FieldNames solution into a value list?

            (A calculation field using this function must be unstored or it won't update if you change the layout. If it's unstored, you can't use it as the data source for a value list.)

            • 3. Re: Fieldnames function problem

              You must be right Phil. I did change the layout. Just now I reproduced this problem. I changed the layout and the FieldNames does not update. I duplicated the layout and then changed the layout name in the Fieldnames function. Did not work. Turned on and off the storage and that did not work.

              The only thing that worked once I changed the layout was to delete the calculation and then recreate it. _cFieldList FieldNames (Get (filename); "SearchFields2"

              Do you agree? That is the only way tomake it work once the layout is changed?

              Thank you once again. I know a little more now.



              • 4. Re: Fieldnames function problem

                One more thing. It is not possible to change the layout and make this work if work is done while the db is hosted on the server. Removed db from server and did the same steps on the desktop. It worked. Then uploaded working db to server.

                • 5. Re: Fieldnames function problem

                  Here's a possible work around:

                  Make the calculation an unstored calculation so that it is always correct. Add a second text field to use as the value source for your value list. Use the OnLayoutExit script trigger to copy the contents of the unstored calc field to the text field via a set field step.

                  Since any layout change will require visiting and exiting the layout, you should be able to make this work to keep an updated field name list in your value list. I suspect that you may have to discipline yourself to always return to browse mode after modifying the layout instead of immediatedly changing layouts, but since layout mods should only be done by the developer, this should be a limitation you can live with. (And if you forget, you can force the update just by going to the layout and then leaving it again, you can even script and update of the text field as part of the start up process when you open the file just to make sure the list is always up to date.)

                  • 6. Re: Fieldnames function problem

                    Okay, finally had some time for fooling around so copied the working db and uploaded to server for the test.

                    Changed 'search fields' layout and saved and exited layout so I am in browse mode (usually do I think).

                    Changed name of _FieldList to _FieldListUnstored and tell it to be unstored.

                    Create text field FieldListForValueList

                    Change Value List to refer to above field.

                    Make script to set FieldListForValueList to _FieldListUnstored

                    In Layout setup tell search fields layout to perform that script on layout exit.

                    IT WORKS!

                    FABULOUS! Thank you once again.