Link to home
Start Free TrialLog in
Avatar of rvfowler2
rvfowler2Flag for United States of America

asked on

GTRR to an External Layout Not Working

Regarding GTRR, Filemaker help says, "When used with a table in an external file, this script step will open the file containing the external table and, if selected, go to the external layout you specify."  However, I've had consistently uneven experiences with GTRR and external layouts.  

Currently, I cannot get any of my 4 portals to go to their external layout; nothing happens.  I checked this via Script Debugger and the script step is firing (see attached screen print).  This happens whether or not it is fired via the button setting or OnObjectEnter.  Whenever I have a GTRR going to an INTERNAL layout, it works fine.  Thanks in advance for any suggestions.
-Capture.JPG
-Capture2.JPG
Avatar of Will Loving
Will Loving
Flag of United States of America image

None of the portals on your screen shot are using the relationship "TENANTS_ALL" which is what your Go To Related Records (GTRR) script set is based on. The GTRR script step has to be based on the relationship of the portal or a valid secondary relationship. Either you need to change the portal relationship or, if TENANTS_ALL is a secondary relationship tied to one of the ones on your layout then you need to check the validity of both set of keys.
Avatar of rvfowler2

ASKER

Actually, I have 4 different GTRR script steps, each with their own TO source.  I'm going to a different file, so it seems normal that the TO names are different although they are from the same table.  Are you saying that my TO names in the Vacancy file has to be the same as the portal names I have in PropInfo file?
No, the TO names can be different but I think you have issues with the relationship specified in the script.  I think my initial comment about the GTRR script steps not matching the portal relationships was incorrect.

When you use a GTRR script step between files, the relationship used must be a valid relationship from the portal you are clicking in to the a table in the other file that is on the relationship graph in your current file. Your script step clearly shows an "External" layout selected so I would have to guess that the relationship is invalid between the record you are clicking on and the other table.

However, you should first test the GTRR script itself. Are the parameters from each portal correct and actually being passed? Is the script in the file that you are working in or the one you want to go to? It should be in the starting file, not the destination file. Try adding the GTRR step directly to one of the portals, bypassing the script and script parameter entirely.
I guess I'm not sure what you mean as valid.  First, the portal TO is valid because data shows up correctly in the portal.  The layout I'm going to in the other file can't be based on a TO related to this file because the TO is in the other file.  I must be missing something obvious.
The relationship assumedly goes from a table and TO in the current file to a TO - in the current file - for a table that exists in the other file. Which is why you have the option to display the External Layouts.

One other thing that I noticed is that you are performing a script prior to the GTRR step. If that script changes or removes the "focus" on the current portal and portal record, then your GTRR will fail. Disable or remove that script and see what happens. Also try the test of just using a single GTRR step directly from one of the portals.
Narrowed down to one script step as you said.  Used Script debugger to ensure that the script step ran, but again it did not take me to another layout.  Also, in the attached showing the TO in PropInfo as well as the GTRR script step to show that it is based on the same table to which I am going.
-Capture3.JPG
And, fired it off both as a button and as an OnObjectEnter Script trigger.  Neither worked.
And, again, to clarify.  The weird issue is that the GTRR step works if it is the only step I run, but when put as a script step, it does not work.  That's the only difference.
The only thing I can think is that something is causing focus to be lost. Please clarify when it works:

1. If the button in the portal is set specifically to run the single GTRR script step
2. If the button in the portal works IF the script it's linked to contains just the single GTRR step and nothing else.
Yes, just tried it both ways just now with the Script Debugger running and not running.  #1 works (single step via a button) vs. #2 does NOT work (single step within a script off a button).  This is activated when I click on any of the fields in one of the portal rows.  Same field in some row, but #1 works and #2 does not even though I can see in Script Debugger that the GTRR script step fired.  Weird.
I assume the script you're running is in the local file and not the related file… can't think of what else it might be but it sounds like you have at least a workaround for the moment. Be aware that on rare occasions something will work without the Script Debugger but will fail when the Debugger is on.
Yes with Debugger, that's why I ran it both ways and both with the Debugger open and with it closed.  Same results.  The script is in the local file.  Yes, have a workaround where I simply save key info in a couple of global fields and then open the related file, go to the layout, and do a Find using the global fields.  At least this way I can implement my Previous Layout script/button as well.
ASKER CERTIFIED SOLUTION
Avatar of Will Loving
Will Loving
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, your workaround is an acceptable solution; I just also wanted to return by Previous Layout which is outside the scope of the original question I asked, so not docking you for that.  Giving credit.