5 Replies Latest reply on May 17, 2013 12:32 PM by rwallace4284

    Adding New Portal Row - Record

    Mitch

      Title

      Adding New Portal Row - Record

      Post

      I have a portal row that keeps record of Images attached to a parent record. Along with the portal row is a button and script that adds a new portal row and record.  The portal row is sorted by "TimeStampCreated (Descending)"

      Therefore when you add a new portal row, the new row will be at the top of the portal (newest record) and the curser will move to the first field in the new row for the input of data.

      However, its suits the type of data to have the portal row sorted "TimeStampCreated (Ascending)".  Obviously with add new portal row, the new portal row will now be at the bottom of the portal (last record).  This is no issue. 

      What is an issue is that with ascending sort, the cursor still moves to the first field in the top of the portal row (oldest record).

      How do I get the cursor to move to the newest portal row, bottom of the portal for data input...? 

        • 1. Re: Adding New Portal Row - Record
          RonCates

          What is the script for creating the new record? Does it maybe end with a goto portal row first step? If so you may just need to change it to goto portal row last.

          • 2. Re: Adding New Portal Row - Record
            Mitch

            The Script:
            Set Variable [$NoteID; Value:Main Page::RepcientID]
            Freeze Window
            Go to Layout ("Images Portal" (Images Portal)]
            New Record/Request
            Set Field [Images Portal::RecipientID; $NoteID]
            Commit Records/Requests [Skip data entry validation; No dialog]
            Go to Layout [original layout]
            Got to Field [Images Portal::Image_Title]
            I have tried the "Go to Portal Row", both "New" and "Last" prior to the "Go to Field Line".  However, the focus still remains on the Image Title Field on the first record...not the newest record and the end of the portal...?

            • 3. Re: Adding New Portal Row - Record
              dataWolf

              I don't understand everything that is happening but try the Go to Portal Row AFTER the Go To Field step.

              • 4. Re: Adding New Portal Row - Record
                philmodjunk

                If you have more than one portal on your layout, there can be problems because Go To Portal Row selects a portal row of the portal that currently has the focus and that could be the other portal.

                Go To Field, as dataWolf recommended, is one simple way to give the correct portal the focus so that Go To Portal Row works the way you'd expect.

                You can also give the portal an object name and use Go To Object to give it the focus. (With filtered portals in Filemaker 11, you might have two portals to the same table occurrence and then Go To Field might still fail to set the focus correctly if both portals have this same field.)

                • 5. Re: Adding New Portal Row - Record
                  rwallace4284

                       @ dataWolf

                       I had the same issue with one of my layouts that contained multiple portals.  (Each script worked when I removed the other portal.)  The solution was simply changing the focus with

                       Go to Field [Location::Name]

                       before 

                       Go to Portal Row [Select,Last]

                       Thanks!