2 Replies Latest reply on Apr 17, 2010 7:49 AM by idwhite

    View details of portal row within same layout



      View details of portal row within same layout




      Newbie here... FM 11/  on a MAC


      I have a Layout(1) that is showing related records from Layout(2) in portal rows.  I want to allow the user to click on a button to show only the details from that row in a field next to it. Such as large amounts of text. It needs to be editable and change the information in the portal row/and that particular record.


      At the moment, I have seen something similar in the FM Starting Solution and have tried implementing the scripts, relationships, tables etc... and to no avail.  The script is not pushing the correct information into the field on the right. 


      Anyone out there know?

      Thanks so much!

        • 1. Re: View details of portal row within same layout

          To illustrate the solution, let's say you have two tables with a layout for each of the same name: Parent, Child.


          In Parent, we'll just define two fields for this demo: ParentID, set up as an auto-entered serial number and SelectedChild as a number field.


          In Child, we'll define these fields: ParentID (number field) , ChildID (auto-entered serial) , Name (Text) , LargeText (text)


          For your portal, you'd have the following relationship:

          Parent:: ParentID = Child:: ParentID


          Now you can place a portal to child with Name in the portal row to display every record in Child with a ParentID number that matches the current record on the Parent Layout.


          For your detail field we need an extra table occurrence of Child. In Manage | Database | Relationships, click Child to select it and then click the button with two plus signs to make a second table occurrence.


          Define a second relation ship as: Parent::SelectedChild = Child 2::ChildID


          Now you can place the LargeText field from Child 2 on your Parent layout.


          GIve your button this script:

          Set Field [Parent::SelectedChild ; Child::ChildID]


          and you're done.

          • 2. Re: View details of portal row within same layout

            Worked beautifully. I have no idea why I could not wrap my brain around this problem as it seems so simple now!