6 Replies Latest reply on Mar 19, 2010 11:38 AM by fitch

    Get (Foundcount) Function

    dnnkpp

      Title

      Get (Foundcount) Function

      Post

      Snow Leopard, MBP, FMP 6.0 and FMP 10v3

      I have two files A and B. I have set up a script in A to execute an external script in B that uses the Get (Foundcount) function. The script works without a hitch in B and places the correct number in the designated field. I have established a relationship between A and B. In A, I have a field that uses the relationship to show the Get (Foundcount) from B.

       

      In FMP 6.0, this worked flawlessly (the function then was named Status(CurrentFoundCount). When I converted the files to FMP 10, the relationship appears to work improperly as it reports a value of "1" instead of correct value of 58 as FMP 6.0 does.

       

      Does anyone have an explanation as why this is happening? Thanks for any help you might provide.

        • 1. Re: Get (Foundcount) Function
          fitch

          Possibly the wrong window is selected when the calc is evaluated.

          • 2. Re: Get (Foundcount) Function
            dnnkpp

            I go to file B and show all of the records (more than 2000 of them). I then go to A and run the script. When I look in file B, the correct number (58) shows up but this value does not show up in the related file in File A (it just shows a '1') Why did it work fine in FMP v6, but not in FMP v10. Was there a conversion issue?

            • 3. Re: Get (Foundcount) Function
              fitch

              That was kind of my point.

              • 4. Re: Get (Foundcount) Function
                fitch

                FileMaker Pro no longer brings a file to the front when a script in that file runs. You have to explicitly tell it to do so.

                 

                You haven't supplied a script, but my guess is that your script in File A calls a script in File B that sets the found count. At the beginning of that script in File B, try putting a Select Window[Current Window] step.

                • 5. Re: Get (Foundcount) Function
                  dnnkpp

                  I really appreciate your attempts to help me.

                   

                  I did as you mentioned with the select window. It didn't work. The find script performs the find. That to my mind is not the issue. It getting to display the value it obtains from the Get IFoundcount) function in file B back in file A when the relationship has been established. For fun, I changed the related field to another file in file B and it displayed fine. Seems to be an issue the the Get (foundcount) function is used.

                   

                  Guess I will have to admit defeat. Not critical, but worked fine in older version of FMP so couldn't understand why I couldn't get to work in v10.

                   

                  Thanks again for your help!

                  • 6. Re: Get (Foundcount) Function
                    fitch

                    You still haven't provided any detail about your scripts or relationships.

                     

                    But look, there are a number of ways to resolve this. For example, if you put the Get( FoundCount ) result into a global field, then you don't even need a relationship to access it.