AnsweredAssumed Answered

Layout exit triggers cause GTTR scripts to lose context

Question asked by smith7180 on Jan 24, 2019
Latest reply on Jan 30, 2019 by TSGal

Any Layout exit trigger (even a one triggering a blank script) will cause a go to related record step to lose context and thus fail if the button activating the gttr it is on a joint table portal.


FileMaker 17, tested on both macOS Mojave and Windows 10.


I've attached a sample file. I created it following these steps:


  • Create 3 tables for a many-many relationship. That is- the primary keys of two tables connect to 2 foreign keys in the join table:

Screen Shot 2019-01-24 at 2.21.38 AM.png

  • Create Layout_1 based on Table_1 and Layout_2 based on Table_2
  • Put portal to join_table on Layout_1
  • Place go to related record button on the join_table portal row that goes to the corresponding record in Layout_2
  • Create a few records in Layout_1 and Layout_2, and create corresponding records in join_table so you can run the test:
  • Screen Shot 2019-01-24 at 2.46.33 AM.png
  • Now try click the go to related record button. It works correctly every time. That is to say, when you press the button, you go to the correct record in Layout_2:
  • Screen Shot 2019-01-24 at 2.27.16 AM.png
  • Now create a blank script, and assign it to the layout exit trigger for Layout_1. Now when you press "go to related record" in Layout_1, it will go to the first record in Layout_2, not the record corresponding to the portal row.


Taking the above images as an example, if you press the GTTR button on the second row corresponding to ID FF7... it will take you to record FF7... UNLESS you have a layout exit script, in which case no matter which gttr button you press, you will always go to D84... i.e. the first record.


This is exactly what happens elsewhere in FileMaker if an action causes a portal to lose focus (like a commit records script). However nothing in the layout exit should remove focus from the portal as there are no steps at all in the script.


If the table occurrence for the portal is the destination table (i.e. Table_2) instead of the join_table, there is no problem.


In summary, the issue occurs when there is both a layout exit trigger and the portal is to the join table, not the other parent table


I've attached the example file. Thanks for your attention.