3 Replies Latest reply on Aug 17, 2011 8:19 AM by philmodjunk

    Go to Related Record … Doesn't

    AndyAnderson

      Title

      Go to Related Record … Doesn't

      Post

      I have a script that does nothing besides going to a related record. It's executed in a layout that has a number of portal records displayed, but based on information from custom dialogs, the related record is correctly reported before Go To Related Record and it changes to something else when it's reported after — usually but not always the portal record selected on entry to the layout — and the latter is where it goes. Oddly it stays the same if the Go to Related Record requests the result option "Show in new window".

      Thanks for any insight.

      FMPA 11.0.4 — this was working for a while and the change may be that I updated from 11.0.3!

      -- Andy

        • 1. Re: Go to Related Record … Doesn't
          AndyAnderson

          After trying a few more variations of my setup, the issues seems to be a script that I run on exit from the current layout to clean up some status variables. If I don't do that, it works fine. This seems related to the discussion in this article:

          http://help.filemaker.com/app/answers/detail/a_id/3611/kw/related%20record

          where it says "Another instance where it may appear that the script step Go to Related Record is not working is if it is not the last step in a script. Actually, it is working. Go to Related Record opens the related database and goes to the relatedrecord but returns to the original file to finish executing the rest of the script. This can be particularly confusing when the script step it is returning to execute is simply End if." In my case, I guess, it's returning to execute the OnLayoutExit script and then returning to wherever it wants in the new layout, forgetting the previous Go to. It doesn't seem to me that it should work this way — the latter script should execute on the way out, not after coming back.

          In any case, the solution described in this article doesn't work for me. And I can't just relocate the onLayoutExit script because I need to clean up these variables in a general way, since I don't know how users will move around within the database. So I've come up with this solution to replace the simple Go to Related Record [From table: "Strains"; Using layout: "Strains" (Strains)]:

          Set Variable [$$StrainID; Value:Strains::StrainID]  # Correctly set from related record

          Go to Layout ["Strains" (Strains)]

          Perform Find [Restore]   # Criteria: Strains::StrainID:[$$StrainID]

          Show All Records

           

          • 2. Re: Go to Related Record … Doesn't
            LaRetta_1

            Oh, Andy, no ... I suggest that you figure out the inconsistency instead of dropping GTRR from your toolkit and performing a search instead. 

            When I use triggers to set/clear variables based upon Layout enter or exit, I include a test for in script.  I cannot say for sure unless I can see your file but when starting a script such as this, I set a variable to 1 and clear it when script finishes.  Script triggers based upon layouts can then include test for the 1 to determine whether to run or not.

            Can you upload your file somewhere (even use 4shared.com or other free upload site) and then provide a link to it in this thread?  I would be happy to take a look for you. Smile

            • 3. Re: Go to Related Record … Doesn't
              philmodjunk

              Here's a link to a post that attempts to document all the details, limitations, quirks to the Go To Related Records step:

              The Complete Go To Related Record

              If you haven't already read it, it may help you better understand the expected results for each combination of possible options you can select with this script step.