5 Replies Latest reply on Feb 26, 2010 1:08 PM by 3WaveGuy

    Returning to a portal record after going to an unrelated table

    3WaveGuy

      Title

      Returning to a portal record after going to an unrelated table

      Post

      Hi,

      I leave my Main Layout to get info from an unrelated table to put in the record in the 2nd row of my active Portal.

      When I leave the Portal record of my Main Layout I save the Portal row ($g_scratch_row (= row 2)).

      I do my lookup and get the info I need.

      When I return to my Main Layout, I goto the Portal Tab Object, and then Goto Portal Row ($g_scratch_row( = 2)).

      It errors out on Error 101 (record is missing).

      Anybody have an idea what I am doing wrong?

      What I am basically asking is how do you leave a Portal record and then come back to that same record?

      Thanks.

        • 1. Re: Returning to a portal record after going to an unrelated table
          philmodjunk

          Well that sounds like it should work. Since it doesn't you'll need to break things down step by step and see where things went wrong. Do you have Filemaker Advanced? This type of problem is made to order for the debugger so you can watch things happen step by step while you check the values in the data viewer.

           

          If not, you may need to insert a Show Custom Dialog steps that pop up and display the value of your variable just before you use it to make sure it has the expected value.

          • 2. Re: Returning to a portal record after going to an unrelated table
            3WaveGuy

            Hi Phil,

            I have Advanced version and I debugged and see that the row is the same (2).

            I still get the 101Error as if the tab portal isn't the active portal.

            Is there a way to know that this portal is the one I assume is active.

            Faililng that is there a way to securely send the solution so you can see this script (about 10 lines)?

             

            • 3. Re: Returning to a portal record after going to an unrelated table
              philmodjunk

              Before we go that route, why not make a design report of your file and copy the script from this report to this forum thread? That way we can see if there's some obvious problem that keeping this from working.  (I'd also double check your portal's object name and the got object script step to make sure they match.)

              • 4. Re: Returning to a portal record after going to an unrelated table
                3WaveGuy

                Hi Phil,

                That's a fantastic Report! Wow, I never know it existed.

                Here is the script:

                The error 101 occurs after the 2nd to last line:

                 

                • Set Variable [ $nm; Value:Medications::Brand Name ]
                • Go to Layout [ “Record Detail” (Patient Management) ]
                • Set Variable [ $MedID; Value:Patient Management::g_scratch_recd ]
                • Set Variable [ $row; Value:Patient Management::g_scratch_row ]
                • Go to Layout [ “Patient Medication” (Patient Medication) ]
                • Enter Find Mode [ ]
                • Set Field [ Patient Medication::MedID; $MedID ]
                • Perform Find [ ]
                • Set Field [ Patient Medication::Medication; $nm ]
                • Go to Layout [ “Record Detail” (Patient Management) ]
                • Go to Object [ Object Name: "Medication Tab" ]
                • Show Custom Dialog [ Title: "The row is:"; Message: $row; Buttons: “OK”, “Cancel” ]
                • Go to Portal Row [ $row ] [ No dialog ]
                • Go to Field [ Patient Medication::Dosage ]

                 

                Thanks,

                Michael

                 

                 

                • 5. Re: Returning to a portal record after going to an unrelated table
                  3WaveGuy

                  Hi Phil,

                  I got it. I didn't know I had to select the portal object (as your last post suggested).

                  I gave the portal an object name, went to it and bingo it worked perfectly.

                  Great job, thanks so much.

                  I'm learning. Hopefully soon I won't be bugging eveyone so much.

                  Thanks again!