3 Replies Latest reply on Nov 12, 2010 1:30 PM by washutech

    Help with a script

    washutech

      Summary

      Help with a script

      Product

      FileMaker Server

      Version

      11.0.1.99

      Operating system version

      Windows server 2003

      Description of the issue

      PhilModJunk helped me to find out that we have a script error.
      When we click the execute button, a status drop down changes back to the default. We lost our FileMaker programmer and I am trying to fix this from reading a book.

      Steps to reproduce the problem

      This is a picture of the script.

      Expected result

      That the status would save as what was picked

      Actual result

      the status resets

      Workaround

      none

      script.jpg

        • 1. Re: Help with a script
          philmodjunk

          It's hard to suggest much as we don't really know why the script was set up to modify this value in the first place nor how your database has been designed. From your post, it seems you have much to learn about FileMaker and also about the design of your own file. Finding someone in your area who knows FileMaker and can come take a look at yoru file would be a very good idea. If you are going to try making modifications, please make lots of back up copies of your files as you go so that if your changes have unexpected results, you can throw out the file and go back to a back up copy.

          You have 5 lines in your script that make up an If statement:

          If [$$SHOWACTIVEONLY = "Yes"]
              Set Field [...
          Else
              Set Field [....
          End IF
          Then you have this step:
          Perform Find[]

          These set field steps should be taking place in Find Mode, but there is no preceding script step to enter find mode in the first place so it modifies the data in the current record instead of entering criteria for performing a find.

          I see many, many steps that are preceded with // which means that they are currently disabled and thus are skipped when the script is run. One of those disabled steps would have entered find mode and then paused the script so that the user could enter additional find criteria.

          Either this script was deliberately sabotaged by your former developer or it is a work in progress that is in a very messy condition.

          One piece of good news is that you have FileMaker advanced. You can select the script debugger from the tools menu and then run a script, using the debugger controls and the data viewer to watch how the script works one step at a time. This can be a very handy way to learn what a script is or isn't doing.

          • 2. Re: Help with a script
            washutech

            Thank you, I am looking up on how to use the script debugger now.

            • 3. Re: Help with a script
              washutech

              Thank you, I found the two lines and dissabled them and it works. Thank you PhilModJunk!