5 Replies Latest reply on May 27, 2009 3:16 PM by fitch

    Scripts suddenly no longer work.

    DSM

      Title

      Scripts suddenly no longer work.

      Post

      I have had a problem with a script in the past. The script suddenly stopped working. I simply recreated the script exactly as i had it and the new script works find. Now I have another script that has stopped working. This new script is a very simple script. I am afraid to continue to rely on Filemaker Pro if there is a chance that things like this will continue to happen.

       

      Has anyone else had similar problems?

        • 1. Re: Scripts suddenly no longer work.
          philmodjunk
            

          Any time you get unexpected behavior from a Filemaker file, you need to evaluate whether or not your file may be corrupted. Sometimes file corruption will affect one part of a file's function but not others, a find or sort operation, for example may no longer work as expected because the index that filemaker uses to perform that operation could be damaged. This could be true for your script as well.

           

          As a quick test to see if the file may be damaged, recover the file and test the recovered copy to see if that fixes the problem. Watch to see if the recover operation reports back that it found any problems. If no problems were found, open your original copy, (not the recovered copy) and try re-indexing any fields that might be involved. You can also try saving a compacted copy or importing all your data into a clone of your current file.

           

          If the recover operation reports that it found and repaired a problem. It's safest to switch to an undamaged back up copy of your file and import your most recent data from your recovered copy into the back up file.

           

          Don't actually use the recovered copy of the file if you have any alternative.

          • 2. Re: Scripts suddenly no longer work.
            fitch
               Sure, data corruption is a possibility. My first thought here though, is to manually perform the script steps and see if you get the expected result. If you don't, then the problem is with the data, not the script. If you do, then perhaps there is something in the script that is not actually set as you thought it was. It would help to know what the script actually looks like.
            • 3. Re: Scripts suddenly no longer work.
              DSM
                

              The script that has stopped working is simply a "Perform Find".

               

              I have created user accounts and assigned them priviledges to certain records in a table. As a result the records the users do not have permission to view still show up when they open a layout, but the fields say <No Access>. I created this script to run "OnLayoutLoad" that omits all records that contain "No Access". This way the users do not have to view shuffle through hundreds of "No Access" records just to get to the handful of records that they should have access to.

               

              I have tried many different solutions so far. This script has worked in the past, but has recently stopped working. I do not know yet how to perform the "recover operation", but I will certainly look into that. Since I have re-created this particular script, it works via the client, but still does not work when using the web interface.

               

              If I manually perform the find via the web interface everything works as desired. I just created a button to run the script which also seems to work. Perhaps the issue is the triggering of the script "OnLayoutLoad" via the web interface. Any ideas?

               

               

              • 4. Re: Scripts suddenly no longer work.
                claddam
                  

                In my experience, you need access to all the fields in a record to view those records.

                 

                As your layout maybe viewable or modifiable, so do the records need to be, otherwise they won't see the information.

                 

                Also, double check the records that have relationships but are blocked with No Access. That could prevent the script from running. 

                • 5. Re: Scripts suddenly no longer work.
                  fitch
                    

                  You didn't mention before that this was a triggered script and that it's a web-based solution.

                   

                  Triggered scripts do not work in IWP unless the action was initiated by a script. E.g. in this case, a user selecting a layout will not trigger the script, but if you have a button that calls a script that goes to the layout, the OnLayoutLoad script will be triggered.