1 Reply Latest reply on Jan 24, 2011 12:54 PM by Sorbsbuster

    Self-Join Portal Button to Related Records



      Self-Join Portal Button to Related Records


      Edit - Answer appended, Issue resolved

      Hello Folks,

      I'm working on a new database and could use a little help.  FMP11 on Win XP.

      I have a DB with 3 unique tables, but here im concerned simply with a single table. "Mytable"

      This table has a self-join relationship to "MyTable2" on a non-unique field "Cat" using the "=" relation type.  This self-join is to allow a portal on a layout of "MyTable" to show records from "MyTable2" that share a value in "Cat"  Not sure if it matters, but I have the portal filtered to remove the current record from the portal.

      All the above works well.

      My goal is to make one or more fields inside the portal into buttons that bring you to the record shown from that portal row.  I would click this button and I would use the current "MyTable" layout to view the record that was clicked inside the portal. 

      I've tried using a script as well as the 'Go to related record' button selection but i can't figure out how to make it work.  Specifcally for script use, I'm unclear about how i extract unique information from the portal row that i clicked on.  I've made the button from a unique Id field and that doesn't seem to help.  In all cases the script/button will return me to the current record I'm already viewing.

      I've check and the field/buttons are completely inside the portal row.




      Actually, with more experimention I found the answer.

      From the 'go to related records' button selection. I was starting from 'MyTable' when I changed that to 'MyTable2' it did what I wanted.


        • 1. Re: Self-Join Portal Button to Related Records

          Here is an approach that is more universally applicable.  Set a script connected to a button on the portal row to:

          - Capture the unique identifier from that portal row (or the data they have in common) as a $Variable.

          - Go to the portal table's layout

          - Enter Find mode

          - Set the unique identifier field to be that $Variable value

          - Perform find

          That works if it is a unique Secondary Key Field, or if the group of portal records have a common attribute.