1 Reply Latest reply on Jul 28, 2010 8:02 AM by FentonJones

    Showing "detail" of a portal record



      Showing "detail" of a portal record



      I have a relationship as follows:

      [Customers:CustomerID]-[CustomerContactsXRef:CustomerID, ContactID]-[Contacts:ContactID]

      I have a form showing customers. On that form is a portal showing all related contacts. This works fine.

      However, there are more fields in the Contacts table than I can reasonably show across the page in the contacts portal. Therefore I thought a portal (in my mind a grid table) placed on the form showing the contacts, then when the user clicks a record line in the portal, further detail is shown below. No amount of tweaking however wants to make this work. Screenshot of the concept attached.

      Any ideas?




        • 1. Re: Showing "detail" of a portal record

          You can create a global field (in the Customers table), to temporarily hold the ContactID of the portal record (assuming ContactID is the primary key of the Contacts table). 

          Then create a relationship from Customers to Contacts based on the global ContactID to the real ContactID. AND include the CustomerID also.* A button in the portal (could be attached to all fields at once) runs a small script to set the related ContactID into the global, then Commits the record. (Make sure no steps before setting the global cause the script to lose portal focus.)

          The data shown can either be just related fields of the global relationship. Optionally, some or all of the fields and labels can be inside a portal of the same relationship. So they will disappear if there's none matching.

          Another more complex option would be to popup a small sized window, using a dedicated small Contact layout. But then you need a script to create/control/close that "windoid."

          *Unless you also include the CustomerID in the relationship, you will see details from the last time you used the global after flipping to a different Customer record; not good. Including the CustomerID eliminates this problem. Clearing the global onRecordLoad, via a FileMaker 10 Script Trigger, would also, but more work, and not really needed for this.