7 Replies Latest reply on May 8, 2009 12:22 PM by philmodjunk

    Go To Related Record Options: Wrong Results

    montyman7

      Title

      Go To Related Record Options: Wrong Results

      Post

      In the "Go To Related Record Options" I am getting the wrong results.

       

      In my "Result Options" I have selected: "Show In New Window" (working), "Show Only Related Records" and "Match Current Record Only" (not working). 

       

      My Result:

      In my list it will go to my current record but within the found set.

      What I want:

      I want it to ONLY show all related records to the current record.

       

      According to the FM Help I'm doing everything right! Do I need a script that will Perform a find first then Go to Related Record? If so, what should is the script that would work?

        • 1. Re: Go To Related Record Options: Wrong Results
          philmodjunk
            

          I can't tell for sure from your post but it may be that you do not have any related records matching your current record. Is this possible?

           

          It's not documented in the Help system and it should be, but Go To Related Record fails to switch layouts and fails to update the found set of the related table to show zero records if you specify a layout by name and there are no related records.

           

          If it is possible that there are no related records you have to test for that possibility. You can use the count() function to count the number of related records just before or you can use get(lasterror) to check for an error code immediately after the Go To Related Record script step.

          • 2. Re: Go To Related Record Options: Wrong Results
            montyman7
              

            My database is for entertainers that have several events that are scheduled.

             

            Wanted Result:

            Click Button that automatically pulls up all the events scheduled for the entertaine/current record I'm in

              

            • 3. Re: Go To Related Record Options: Wrong Results
              philmodjunk
                

              That doesn't give me any new information to go on. Let's examine your database design.

               

              Are you on a layout for one table and using GTRR to switch to a different layout and display a list of related records?

               

              I think that's what you are doing, but it would help me for you to confirm that.

               

              When you open Manage | Database | Relationship, you do have a relationship linking the two table occurrences?

               

              Does your script fail all the time or some of the time?

               

              In a case where the script fails, can you find the related records manually? (can you enter find mode and find the records?)

               

              • 4. Re: Go To Related Record Options: Wrong Results
                montyman7
                  

                Perhaps I should do create a script

                 

                Perform Find how do I perform a find on the current record?

                Go To Related Records [Show only related records; From table: "Events_Schedule"; Using layout: "Scheduled Events List Report" (Events_Schedule); New Window]

                • 5. Re: Go To Related Record Options: Wrong Results
                  montyman7
                    

                  That doesn't give me any new information to go on. Let's examine your database design.

                   

                  Are you on a layout for one table and using GTRR to switch to a different layout and display a list of related records? YES

                   

                  I think that's what you are doing, but it would help me for you to confirm that.

                   

                  When you open Manage | Database | Relationship, you do have a relationship linking the two table occurrences? YES

                   

                  Does your script fail all the time or some of the time? It doesn't isolate my "current record" it shows all of the records but goes TO the related record.  I want to have a report that is ONLY the related records to the current record I'm on.

                   

                  In a case where the script fails, can you find the related records manually? (can you enter find mode and find the records?) Yes, if I do a FIND on the current record all of the scheduled events show up, but not if I use the script GTRR.

                  • 6. Re: Go To Related Record Options: Wrong Results
                    mrvodka
                      

                    As Phil said, most likely the current record you are on does not have any related records as per that relationship. If you do not error trap it will seem like it does nothing.

                     

                    Try this simple script and run it from that record, then report the results.

                     

                     If [ IsEmpty (Events_Schedule::pkEventID) ]  //I dont know what your primary key is calledso substitute it.

                    Show Custom Dialog [ "No Records" ]

                    Else

                    Go To Related Records [Show only related records; From table: "Events_Schedule"; Using layout: "Scheduled Events List Report" (Events_Schedule); New Window]

                    End If

                     

                     

                    • 7. Re: Go To Related Record Options: Wrong Results
                      philmodjunk
                        

                      Does your script fail all the time or some of the time? It doesn't isolate my "current record" it shows all of the records but goes TO the related record.  I want to have a report that is ONLY the related records to the current record I'm on.

                       

                      To repeat the question: All the time or only some of the time? In otherwords does it work for some records but not others?

                       

                      In a case where the script fails, can you find the related records manually? (can you enter find mode and find the records?) Yes, if I do a FIND on the current record all of the scheduled events show up, but not if I use the script GTRR.

                       

                      If you can use other means to find the "related records" then something is wrong with your relationship. Describe the two tables and their key fields. (If this self join, name both table occurrences and give the key fields).