4 Replies Latest reply on Mar 25, 2014 12:49 PM by philmodjunk

    Using Global Variable to display Found Count

    sccardais

      Title

      Using Global Variable to display Found Count

      Post

           I want to display the found count is a text string using a global variable but I'm having trouble getting the global variable to refresh.

           I created a script to set a global variable with the Found Count.  Set Variable [$$SurveyFoundCount; Value:Get(FoundCount)]

           The only way I can get this variable to update is to switch from Browse to Layout mode and back to Browse. 

           How can I get this variable to update whenever the found found changes?

           Once that's resolved, am I correct in assuming I can use this variable in outer layouts including layouts based on different but related tables?

            

        • 1. Re: Using Global Variable to display Found Count
          philmodjunk

               Both refresh window and Refresh Object (if you given the variable and object name) could be used for this, but you don't need a variable nor a script for this.

               While in layout mode select the layout text tool and click the layout where you want this found count to appear. Then pull down the insert menu and select "FoundCount" from the dialog that pops up when you select "other symbol".

          • 2. Re: Using Global Variable to display Found Count
            MarcMcCall

                 You could put this in a web view and shrink it down and use it anywhere in your file and will work and updates, or use the bottom calculation, but it doesn't work in a global field.

                 Let([
                 Rn = Get(RecordNumber);
                 Fc = Get(FoundCount);
                 Tc = Get(TotalRecordCount)];
                 "data:text/html,<html>¶
                 <head>¶
                 <title>NavText</title>¶
                 <meta name=\"generator\" content=\"FileMaker Pro 12\">¶
                 <meta name=\"author\" content=\"Marc M\">¶
                 </head>¶
                 <body bgcolor=\"#54566c\" TopMargin=\"4\" style=\"border:0\">¶
                 <center>
                 <font color=\"#FFFF00\" face=\"Verdana\" size=\"-3\">¶
                 Record " & Rn & " of " & Fc & 
                 If(Fc = Tc; " Total"; " Found.") & 
                 "</font><br>¶
                 </center>¶
                 </body>¶
                 </html>"
                 )
                  
                  
                  
                  
                      Let([
                      Rn = Get(RecordNumber);
                      Fc = Get(FoundCount);
                      Tc = Get(TotalRecordCount)];
                      Record " & Rn & " of " & Fc & 
                      If(Fc = Tc; " Total"; " Found.") )

                  

            • 3. Re: Using Global Variable to display Found Count
              sccardais

                   I thought I'd need the global variable if I wanted to display the found count from Surveys on a different layout -- Ranking of Issues in this case.

                   Is that correct? When displaying the Ranking of Issues on a subset of Surveys, I want to make it very clear.

                   Marc McCall: Thanks very much for your script.

              • 4. Re: Using Global Variable to display Found Count
                philmodjunk
                     

                          thought I'd need the global variable if I wanted to display the found count from Surveys on a different layout -- Ranking of Issues in this case. Is that correct?

                     Yes, but then there should not be any problems with the global variable correctly showing that value. You would assign the value to the global variable and then switch to the report layout where the global merge variable should correctly display the value that your script assigned to it.