11 Replies Latest reply on Nov 18, 2009 9:42 AM by senriz_1

    Search Script Stopped Working

    senriz_1

      Title

      Search Script Stopped Working

      Post

      I'm a novice using FMP9 Adv.  I have a db with a student TO, a school TO, IST Test TO, OPI Test TO, and a CAT Test TO.
       
      Each of the Test TOs have a coordinating Form Layout where data is entered and a  coordinating Report Layout.

       

      I have a script that brings up a new layout called Test Finder for each Test Form Layout where specific criteria is entered and then reported in the Test Report Layout.

       

      One stopped working.  It gives an error that no specified criteria is found.  I've checked everything, the relationship, the layouts in the script, the sort in the script.  Verified everything with an older copy where it does work and can find NO change anywhere.

       

      From an older copy, I've even imported the table, data, made duplicate layouts, scripts, changed layout references, sorts, set up the relationship, etc., and it still won't work.

       

      However, I can create a new record in the test form and the report script works fine for the new data only.

       

      Any assistance would be soooo appreciated.

        • 1. Re: Search Script Stopped Working
          philmodjunk
            

          We might spot something if you post your script. Since you have advanced, an easy way to do this is to generate a database design report and then copy/paste the text from the report to the forum.

           

          One possibility: if your script uses copy/paste steps instead of set field to build the find request, this error can happen if one of the referenced fields is no longer present on the layout. 

          • 2. Re: Search Script Stopped Working
            senriz_1
              

            Here's my script.  The school layout is actually called Campus.  The relationship to the layouts is by StudentID. 

             

            Allow User Abort [ On ]

            New Window [ Name: "Specify Criteria"; Height: 0; Width: 0; Top: 0; Left: 0 ]

            Go to Layout [ “CATTestByCampus&Grade Finder” (CAT Test Data) ]

            Show/Hide Status Area

            [ Show ]

            Adjust Window

            [ Resize to Fit ]

            Enter Find Mode [ ]

            [ Pause ]

            Pause/Resume Script [ Indefinitely ]

            Perform Find [ ]

            Go to Layout [ “CAT Comparative Results by Campus & Grade” (CAT Test Data) ]

            Adjust Window

            [ Resize to Fit ]

            Print Setup [ Orientation: Landscape; Paper size: 8.5" x 14" ]

            [ Restore; No dialog ]

            Sort Records [ Specified Sort Order: CAT Test Data::c_CampusName; ascending

            CAT Test Data::Test Year; ascending

            CAT Test Data::Test Grade; ascending

            Student Data::LName; ascending ]

            [ Restore; No dialog ]

            Enter Preview Mode

            Adjust Window

            [ Resize to Fit ]

            • 3. Re: Search Script Stopped Working
              senriz_1
                

              This script works and it's for another test and is just like the CAT script... just in case you wanted to compare.

               

              Allow User Abort [ On ]

              New Window [ Name: "Specify Criteria"; Height: 0; Width: 0; Top: 0; Left: 0 ]

              Go to Layout [ “OPITestByCampus&Grade Finder ” (OPI Test Data) ]

              Show/Hide Status Area

              [ Show ]

              Adjust Window

              [ Resize to Fit ]

              Enter Find Mode [ ]

              [ Pause ]

              Pause/Resume Script [ Indefinitely ]

              Perform Find [ ]

              Go to Layout [ “OPI Camparative Results by Campus & Grade” (OPI Test Data) ]

              Adjust Window

              [ Resize to Fit ]

              Print Setup [ Orientation: Landscape; Paper size: 8.5" x 14" ]

              [ Restore; No dialog ]

              Sort Records [ Specified Sort Order: OPI Test Data::c_CampusName; ascending

              OPI Test Data::OPI Test Year; ascending

              OPI Test Data::OPI Test Grade; ascending

              Student Data::LName; ascending ]

              [ Restore; No dialog ]

              Enter Preview Mode

              Adjust Window

              [ Resize to Fit ]

               

              BTW... both reports have a sub summary by c_CampusName followed by another sub summary by Grade.

              • 4. Re: Search Script Stopped Working
                philmodjunk
                   The scripts look fine. They both rely on the user to enter valid search criteria and you'll get the message you describe if the user does not enter valid search criteria. What are you (or another user) criteria are you entering that triggers this error message?
                • 5. Re: Search Script Stopped Working
                  senriz_1
                     The search criteria is the Campus Name, Test Year and Grade... all of which I verified is in the Test Form Layout...  it's a bizarre error.  I do have a copy of my database from a several days ago where it does work (of which I have compared everything and it's all the same).  I can use that.  I'll just have to copy over all the additions I've created, which is a lot. 
                  • 6. Re: Search Script Stopped Working
                    philmodjunk
                      

                    That's what you should do. It definitely sounds like your current file is damaged.

                     

                    I'd recover the file first, then copy elements from it to the undamaged back up. You can also use import records to copy any new data from the damaged file to the back up.

                    • 7. Re: Search Script Stopped Working
                      senriz_1
                         I will do that.  Thank you.
                      • 8. Re: Search Script Stopped Working
                        senriz_1
                           I found the problem causing the CAT Test script to stop working, which makes no sense at all considering it doesn't affect the other Test Scripts that I previously mentioned.  As i was coping over the changes to the copy of the db where the CAT script still works, i ran the script each time after every change.  After enabling a relationship for a Filtered Portal, the script stopped working.  I recently found a lesson on Filter Portals in the Filemaker Training Series 9, lesson 9.2.1.  Set it up in the exact same senerio between my Campus TO and Student TO, respectively in the lesson Customer TO and Customer_Order.  I used this resolve a post, Using a checkbox to hide/unhide a field in a portal... I couldn't get the conditional format to work (not sure what I was doing wrong).  Anyway, I was able to get this filtered portal to work, once enabled the CAT script stops, but the other two Test Scripts works just fine.  Rechecked all the steps and fields they are as said.  Any thoughts or perhaps some more insight to the conditional format?  Thanks...
                        • 9. Re: Search Script Stopped Working
                          senriz_1
                             I found and fixed the problem... in the search form where the Campus Name, Test Year and Grade are entered I changed the CampusData::CampusName to CATTestRecords::c_CampusName and it worked like a charm... But, then the other two test that were working stopped working, so I changed there search from to the c_CampusName fields and all is well with this database tonight.  I just don't understand how that filtered portal relationship would affect those reports... bizarre.
                          • 10. Re: Search Script Stopped Working
                            philmodjunk
                              

                            The issue might lie with the check box format you mentioned.

                             

                            When you format a field with checkboxes or radio buttons, any value already stored in the field that does not match one of the values in this value list will be invisible unless you remove the check box or radio button format from the field. Thus, the field can appear empty but actually is not.

                            • 11. Re: Search Script Stopped Working
                              senriz_1
                                 That's probably what I did.  Thanks again for all your help... very much appreciated.