1 2 Previous Next 17 Replies Latest reply on Feb 18, 2017 10:08 AM by tolson

    Perform Find not working correctly

    tolson

      All of a sudden each perform find I have in my db starts each set with the third record in the sequence.

       

      This happened unexpectedly yesterday and I have no idea what I did. Even going back to back up copies before the problem turned up show the same problem.

       

      I have a six record set that is found and at the top of each page, it shows 6/90, but the slider is always pushed so the set opens to the third record. If I manually push the slder back to the first record, it goes right back to the third record the next time I open the set.

       

      This is how the find is structured:

       

      Perform Find [Restore]

      Go to Record/Request/Page [First]

      Go to Layout ["ViewStats" (tblVitals)]

      Go to Record/Request/Page [Next; Exit after Last]

       

      I pull out  the "Go to Record/Request/Page [First]" line nothing changes.

       

      When I reach the last record, it just hangs, it doesn't Exit.

       

      Any assistance would be appreciated. I wasted half a day trying to rectify / modify  the problem to no avail.

        • 1. Re: Perform Find not working correctly
          alecgregory

          Sounds like you have either file corruption or an OnRecordLoad script trigger on that layout. Post the file here if you can.

          • 2. Re: Perform Find not working correctly
            philmodjunk

            A) your script changes layouts after performing the find. If the original layout is not based on the tblVitals table occurrence, the find and folllowing go to record step will not have any effect on what you see on the "viewStats" layout.

             

            B) the last step in your script goes to the next record in the tblVitals found set. The only way this script can leave you on the first record would be if you had a found set of a single record.

            • 3. Re: Perform Find not working correctly
              alecgregory

              Sorry, I read that wrong. I thought you said that the slider bounced right back to record 3 and refused to go to record 1. Phil's post is relevant to you problem, mine is not.

              • 4. Re: Perform Find not working correctly
                tolson

                So now I have reorganized the script thus:

                 

                Go to Layout ["ViewStats" (tblVitals)]

                Perform Find [Restore]

                Go to Record/Request/Page [Next; Exit after Last]

                 

                But nothing changes.

                 

                The script is triggered by a button on the previous form that is based on the same table structure as this script.

                 

                I should have been more specfic in my expectations: I felt the "Go to Record/Request/Page [Next; Exit after Last] command would dump me out of the current script. I didn't expect it to recirculate to the beginning of the found set.

                 

                I'm still having the foundset jump to the third record in the found set

                • 5. Re: Perform Find not working correctly
                  philmodjunk

                  "I felt the "Go to Record/Request/Page [Next; Exit after Last] command would dump me out of the current script. I didn't expect it to recirculate to the beginning of the found set."

                   

                  It does not take you to the beginning of the found set. It does exactly what it says. It takes you to the next record in the found set. It will only exit if the current record is the last record in the found set. Immediately after a find, this will only happen if the find found a single record.

                  • 6. Re: Perform Find not working correctly
                    tolson

                    I'm sorry, it sounds like I'm frustrating you. I appreciate your help.

                     

                    I understand it would not take me to the beginning of the found set.

                     

                    What is happening, is I'm finding the 6 records I need, but the first record showing up in my layout is always number 3 in the set. When I scroll through and get to record 6 (the last in the found set), nothing happens. It doesn't leave the script, the layout, nothing. It just sits (perhaps that is what it is supposed to do is what you're saying and I'm misunderstanding). If I want, I can slide the slider back to the beginning and go to record 1, and 2.

                     

                    The real issue is that I always start the found set on the third record, not the first.

                    • 7. Re: Perform Find not working correctly
                      philmodjunk

                      Have you posted the entire script or just part of it? If this is just part of the script, please post the complete script.

                       

                      Scripts can be posted as screen captures from the scripts workspace, copy/pasted as text from a PDF of the script or copy/pasted from a database design report.

                       

                      Moving the slider has nothing to do with what your script does. Scrolling through the records before or after the script will have no effect on what the script does.

                       

                      The scripted find will always make the first record the current record. The goto next record will always change that to the second record if more than one record is found. I see nothing in the script posted thus far that would leave you on the third record.

                       

                      If you have FileMaker Advanced, enable the script debugger, run your script and then click the "step in" button to step through your script and watch what happens. This will provide you with the best and immediate feed back on what your script is doing and why.

                      • 8. Re: Perform Find not working correctly
                        tolson

                        That's the script in it's entirety.

                         

                        The Perform Find is merely

                         

                        tblvitals::categoryindex       =2

                        tblvitals::roundindex           =1

                         

                        This is pulling up the correct data set.

                         

                        This is the found set indicator immediately upon entering the correct layout. I haven't done anything to the slider or record navigation buttons.Slider.JPG

                        • 9. Re: Perform Find not working correctly
                          philmodjunk

                          And your script will never leave you on the first record unless you have a found set of 1. In all other cases, go to next record will take you to the second record. The point that I've been trying to make is that you expect to see it on the first record and that's impossible in the script that you've been describing.

                           

                          Nothing in your script takes you to the third record.

                           

                          From here, I can only guess as to possible reasons:

                          a) You are looking at the wrong script (sorry, don't mean to offend, but it happens)

                          b) A script trigger is being tripped that performs yet another script that leaves the third record as the current record.

                          c) The file, or at least it's index is damaged. In this case, you can recover the file and test the recovered copy to see if that fixes the issue. If it does, you might try just rebuilding the index.

                           

                          for a) and b) using FileMaker Advanced's Script debugger would quickly determine if either are the case.

                          • 10. Re: Perform Find not working correctly
                            tolson

                            Thanks Phil.

                             

                            No worries about viewing the wrong script - been there done that. I'm on the right script and there are no other triggers on the layout, the previous button or any other element on the layout.

                             

                            I think your indexing corruption is right on. I turned back the clock to a waaaay earlier version and see the exact script and it works. So it looks like back to rebuilding.

                             

                            Don't have Advanced so script debugger is out.

                             

                            Thank you!

                            • 11. Re: Perform Find not working correctly
                              BruceRobertson

                              We don't know what layout - or what record - is the starting point for this script.

                              Since tolson is not forthcoming in providing the big picture here, it's hard to say, and quite frustrating to try to troubleshoot.

                              It is possible that some other action had positioned the user on the third record, in a layout based on the same table occurrence.

                              • 12. Re: Perform Find not working correctly
                                tolson

                                "Not forthcoming". I didn't know I was expected to post the whole file especially after alecgregory steered me towards Phil's answers. I don't expect anyone to do the work for me as I'm aware everyone has their own projects to deal with. I was hoping for some clarifications

                                 

                                I thought I was being forthcoming in trying to clarify things and what my needs were. I'm pretty new here. Truly sorry if I violated some type of protocol.  Guess I should have went to the beginners board.

                                • 13. Re: Perform Find not working correctly
                                  BruceRobertson

                                  " I was hoping for some clarifications"

                                  You get clarifications by posting enough detail to make it easy for the clarifications to be created.

                                  • 14. Re: Perform Find not working correctly
                                    philmodjunk

                                    Hi Bruce.

                                     

                                    So now I have reorganized the script thus:

                                     

                                    Go to Layout ["ViewStats" (tblVitals)]

                                    Perform Find [Restore]

                                    Go to Record/Request/Page [Next; Exit after Last]

                                     

                                    The script is triggered by a button on the previous form that is based on the same table structure as this script.

                                     

                                    and there are no other triggers on the layout,

                                    These are all quotes from Tolson describing his solution. What more do you need in order to tell that "ViewStats" is the starting point for this script?

                                     

                                    I do continue to see some odd inconsistencies in some of the posts here. I rather suspect that the two layouts involved are based on the same data source table but not the same table occurrence. (Check to see if the same exact name appears in "show records from" in Layout Setup for both layouts. But that's just a guess at this point.

                                     

                                    I have my doubts that we will be able to help you much more without actually getting a copy of your file to test.

                                    1 2 Previous Next