3 Replies Latest reply on Mar 28, 2012 3:39 PM by karendweaver

    Goto related record from portal

    Bsabowitz

      Hi All,

      I've hit another bump in the road. I have a layout in a table called "Encounters". On the layout is a portal to a table called "ROS". On the portal is a radio button field called "ROS Answer" with the choices "Reports", "Denies" or "Not Applicable". I set a script trigger on the "ROS Answer" field to trigger when modified. This triggers the following script:

       

      If [ROS_Answer ≠ "Reports"]

      Exit Script[]

      End if

      Go to Related Record[From Table: "ROS" ; Using layout: "ROS Notes" (ROS); New Window

      Pause/Resume Script[Indefinately]

      Close Window [Current Window]

       

       

      So on the new layout (ROS Notes) there is a field called "comments" in which I want to type some text. However, when I enter the field and start typing, I get an error that says I can not modify the field because the record is open in another window. The only other window open is the original layout from the Encounters table.

       

      Can someone explain what I'm doing wrong? I thought of adding a script step to commit the record on the Encounters layout before going to the related record but when I do that for some reason it does not go to the correct related record.

       

      Confusing!

       

      Thanks,

       

      Brian.

        • 1. Re: Goto related record from portal
          karendweaver

          Hi Brian!

           

          Yes, you need to commit the record, but when you do that, FileMaker loses focus on which portal row you were in (because you left the portal row), so it does not go to the right related record.

           

          So first you need to capture the portal row number you are in, then commit the record, then go back to the portal row to go to related record. 

           

          If you have more than one portal on the layout, you will also have to tell FM WHICH portal you want to go to as well as the row.  This is recommended even with one portal - if you start by naming the portal object, then when you add new ones, you won't have to go back and correct this script.

           

          So, let's say that your portal is named "encounter_ros_portal", then your script would need to look like this:

           

          If [ROS_Answer ≠ "Reports"]

             Exit Script[]

          End if

           

          Set Variable [$row ; Value: Get (ActivePortalRowNumber ) ]

          Commit Records/Requests

          Go to Object ["encounter_ros_portal"]

          Go to Portal Row [row number by calculation ; $row]

           

          Go to Related Record[From Table: "ROS" ; Using layout: "ROS Notes" (ROS); New Window

          Pause/Resume Script[Indefinately]

          Close Window [Current Window]

           

           

          That should solve this problem

           

          Karen

          • 2. Re: Goto related record from portal
            Bsabowitz

            Thanks Karen,

             

              Your the best!

             

            b

            • 3. Re: Goto related record from portal
              karendweaver

              Glad I could help!!

               

              Karen