10 Replies Latest reply on Apr 15, 2011 2:24 PM by philmodjunk

    Is it possible to open a specific record from the portal?

    DrDreds

      Title

      Is it possible to open a specific record from the portal?

      Post

      I found this script in a google search:

      Go to Related Record [PortalTable, using layout "AppropriateLayout"]
      Show All Records
      Omit Record
      Show Omitted Only

      That script simply returned whatever record happened to be at the top of the portal list, no matter which record I selected.

      Do the script experts here have any other suggestions?

      Thanks!!

      Gwen.

      FMP 11 Advanced v3; OS 10.6.4

        • 1. Re: Is it possible to open a specific record from the portal?
          bumper

          Your script is overkill, perhaps it is from a different era of FM.

          The keep it simple way:

          In layout mode put/create a button within the portal row.

          When the Button Setup comes up select the script step Go to related record, when that pane come up select the table, layout, only related records, etc.

          Now when you are in Browse Mode and click the button it will now go that related record.

          Later on you will probably want to expand it from a script step to a full script with error trapping, etc. 

          Search this forum for go to related record, Philmodjunk has a written a white paper on GTRR that gives an excellent overview of this subject.

          • 2. Re: Is it possible to open a specific record from the portal?
            rjlevesque

            This depends on where your portal is...for example:

            Is this portal on a layout of that same table? Or is this portal on a layout from a related table?

            Because the methods to do this are a little different for each, not much but a tad different.

            PS - wouldn't say I'm a script expert, advanced yes, but no expert...YET. ;)

            • 3. Re: Is it possible to open a specific record from the portal?
              DrDreds

              rjlevesque,  thanks for your question.  This portal is on a layout of a different but related table.  G.

              • 4. Re: Is it possible to open a specific record from the portal?
                philmodjunk

                your GTRR should also include the "show only related" option and should specify the "table" matching the "table" you selected in Show Records From in Portal setup.

                The follow on steps aren't needed unless you want to isolate this one portal record in a found set of one record and can, on rare occasions, fail to isolate the record if the file is shared over a network. (There are other ways to isolate the record that don't have this limitation.)

                • 5. Re: Is it possible to open a specific record from the portal?
                  Kays

                  heyy,

                  on your portal you could add a button ( call it "show details" for example on a script "show record" for example )

                  show record :

                  (

                  setVariable($var;portal::id)

                  go to layout ( specific layout "L" you want to show the record from )

                  set error capture on

                  perfrom find ( L:id = $var )

                  )

                   

                  in you portal, you will have the button "show details" next to every record of the portal, so if u wanna show the specific detail to the desired record just click on "show details" from the portal.

                   

                  K|Z

                  • 6. Re: Is it possible to open a specific record from the portal?
                    DrDreds

                    PhilModJunk,  when I took off the unneeded script steps as you suggested, it returned ALL related records and not just the one I wanted.

                    Kays, I'm not a script expert, but I tried to set up the script as you suggested but it returned an empty window.  I know I didn't translate your suggestions into a proper script.  Perhaps if I had a screen shot...

                    Here's a link to a screen shot of my attempt of writing Kays' script:   http://www.strittermed.org/publicpictures/

                    Thanks for the suggestions!  Any other ideas?

                    Gwen.

                    • 7. Re: Is it possible to open a specific record from the portal?
                      Kays

                      heyy,

                      you need to change the "portal::id"

                      portal --> the name of the table that you display data from into the portal.

                      id --> is the primary key that identify the records in you table.

                      -----

                      if you could, give me the name of the tables ur working on in ur portal and the fiels so i could give you the whole script.

                       

                      K|Z

                      • 8. Re: Is it possible to open a specific record from the portal?
                        philmodjunk

                        PhilModJunk,  when I took off the unneeded script steps as you suggested, it returned ALL related records and not just the one I wanted.

                        Yes, but the record you clicked in the portal should be the current record. If you are switching to a form view layout, that may be all that you need here.

                        I also use the method Kays is suggesting here, and it works well. It has the advantage of isolating the selected record in a found set of 1 record--which works better than the Show All | Omit | Show Omitted Only method. (With that method, if another user creates a new record at just the wrong instant, Show Omitted Only will bring it into the found set.)

                        • 9. Re: Is it possible to open a specific record from the portal?
                          DrDreds

                          PhilModJunk, you nailed it!  That solution was so simple, I should have thought of it myself...

                          Kays, I tried your method too, but the the script was still wrong.  Clearly I need to beef up my script-writing skills.  Instead of getting you to write the script for me, could you suggest a good way to learn FMP scripting, a kind of reference source?

                          Thanks again.  You guys are both awesome!

                          Gwen.

                          • 10. Re: Is it possible to open a specific record from the portal?
                            philmodjunk

                            You can learn alot by taking a small FileMaker file and experimenting with it. There are tutorials on FileMaker and books on the subject. The best fit for you depends on the level of prior knowledge you bring to the subject.

                            And you are welcome to keep posting questions here in the forum.