3 Replies Latest reply on Jan 9, 2014 7:05 AM by TSGal

    Variable not holding data

    clmiller24

      Summary

      Variable not holding data

      Product

      FileMaker Pro

      Version

      Pro 13 Adv

      Operating system version

      Mac/PC/WebDirect

      Description of the issue

      In one of my scripts, I have it to only enter a spot of the script when it states:

      Get ( FoundCount )  >  $$EntryMax

      I have the window open, data viewer and I am in script debugger.  Earlier in the script it bases the field contents to the variable.  It hit the if statement above, and it still is entering the script.

      Funny thing.  At the end of the script, I wanted to see what data was in the variable.  inserted a a set variable line and inserted nothing into the $$EntryMax and when script is done running , the variable should be gone out of data viewer, but it actually show up with the number 3 in it.   

      It seemed to work okay for a day, than it stopped working.  When back to an old build of the file, worked fine for a while, than it stopped working.

      Image attached to show you the found count, the variable and the debug line in the script.

      Expected result

      Not enter the script

      Actual result

      enters the script

      Workaround

      None yet.

      error_find.png

        • 1. Re: Variable not holding data
          clmiller24

               Sorry, the image I posted, shows it as a $ variable, not $$ variable.  This was my first attempt.  I changed it to $$ so I could track the data from start to end.  

               Also, the script actually runs fine twice.  But it always stops at the third time.

          • 2. Re: Variable not holding data
            clmiller24

                 Okay.. I found a work around, after 5 hours of review and trial and error.

                 I create a new field in the table called "count_found" and I also added the field from another table that was seating the variable to this layout, it is called "entry_max_display".  

                 after the find, I had the script set field to count_found and made it Get (FoundCount).  

                 After which, I ran the If in the script and used this: event_info2::entry_max_display = conference_registration::count_found

                 I attached a screen shot from the data view that shows the two dots beside the field when it was in that line of the script debug (btw, I love that), to show it going to compare the two fields from that layout.

                 And it worked.

                 A lot of extra programming to bypass Get (FoundCount).  

                  

                 BUT.. NOTICE ABOVE (and I only noticed this later.  I use an "=" the second time I ran it, which accomplishes the same thing.  I placed back in a ">" symbol the way it should be, only ran a couple times, and stopped.  So I am not sure it is the Get function or if it is the greater than/less than symbol not working.

                 It is a work around, but does not work in the long run.  We have superusers that are allowed to bypass certain scripts.  And if a superuser allows one extra record (with they can do), but a regular user goes back to add another record, the script will not work because it says equal to, when it should be looking for something greater than what is allowed.  

                  

            • 3. Re: Variable not holding data
              TSGal

                   clmiller24:

                   Thank you for your posts.

                   I still do not have enough information to determine why the script is failing.  Therefore, I would like to see a copy of your file so I can try it here and determine what is causing the issue.  Please see your Inbox at the top of this page for instructions where to send the file.

                   TSGal
                   FileMaker, Inc.