8 Replies Latest reply on Jan 5, 2017 10:35 AM by planteg

    Portal tip question - for multiple data entries

    user28222

      Hi all,

       

      I have a order entry screen with invoice as the base layout and then a portal with invoice line items entered by users.

       

      The portal shows up to 10 rows, and then after the 10th entry, the user has to scroll to make the new record visible.  Is there a way to make the portal go to the new record(without scrolling)?

       

      Ideally, if possible, after the portal screen becomes full, I would like to have the 11th(new record) show on the top of the portal - this is to facilitate continuous data entry with minimal interruption.  There is a portal row button which commits and creates a new record, but after that I don't know how to write the button script to create this behavior.

       

      Let me know if you have any tips to share or if a similar question was asked previously, please point me the discussion link.

       

      Thanks, as always!

        • 1. Re: Portal tip question - for multiple data entries
          planteg

          The Go to Portal Row script step is what you are looking for. Go to Portal Row[Last] will bring the user to the last portal row, the one used to add a new row.

          • 2. Re: Portal tip question - for multiple data entries
            philmodjunk

            You might also put an "add row" of sorts at the top. I've seen a very clever approach where you put a one row filtered portal just above your current portal. The portal filter is set to filter out all records where the match field is not empty and thus only the "add row" appears in that one row portal.

             

            You can also remove the "create" option from the relationship, sort the relationship or the portal to put a blank record at the top and put a button on your layout that uses a script to create a blank related record in the portal's table.

            • 3. Re: Portal tip question - for multiple data entries
              user28222

              Hi planteg,

               

              Thank you for that tip.

               

              I think there might be a bug with the portal handling because even after I inserted the Go to Portal Row[Last] command into the 'Save' button script, the portal scrolls up to the first record of the portal.  My gut tells me Filemaker did indeed go to the last record(active) in terms of processing on the back-end, but only that it is not visible on screen.

               

              To be more precise, here is how my portal looks, before and after.  Assume I have entered 15 records and clicked 'save', after which I would like the 16th(new) record to show on the top of the portal.  Since the portal shows 10 rows at a time, my screen lists records 6 through 15.

               

              <PORTAL BEFORE>

              OrderLineID6      Item6      Qty6        [Save Button][Delete Button]

              OrderLineID7      Item7      Qty7        [Save Button][Delete Button]

              OrderLineID8      Item7      Qty8        [Save Button][Delete Button]

              OrderLineID9      Item7      Qty9        [Save Button][Delete Button]

              ...

              OrderLineID14    Item14    Qty14        [Save Button][Delete Button]

              OrderLineID15    Item15    Qty15      [Save Button][Delete Button]<---Click Save

               

              <PORTAL AFTER Clicking Save on Record #15>

              OrderLineID1      Item1      Qty1        [Save Button][Delete Button]

              OrderLineID2      Item2      Qty2        [Save Button][Delete Button]

              OrderLineID3      Item3      Qty3        [Save Button][Delete Button]

              OrderLineID4      Item4      Qty4        [Save Button][Delete Button]

              ...

              OrderLineID9      Item9      Qty9        [Save Button][Delete Button]

              OrderLineID10    Item10    Qty10      [Save Button][Delete Button]

               

              Am I missing something?

               

              Thanks!

              Wonmoh

              • 4. Re: Portal tip question - for multiple data entries
                user28222

                Hi philmodjunk,

                 

                I had already unclicked the relationship options('create' and 'delete',) and will now try your suggestion of having two portals to mimic the behavior that I am seeking.

                 

                Much thanks!

                Wonmoh

                • 5. Re: Portal tip question - for multiple data entries
                  planteg

                  Hum,

                   

                  I found out that if there is no scroll bar on the portal, portal will not get to the empty row. I guess it's not the case for you since you do not want to scroll manually.

                   

                  Do you FMP Advanced ? If so, you could use the script debugger to get what script step brings the portal to top.

                   

                  Note that the portal will not scroll in order to show the last line on the first displayed row.

                  • 6. Re: Portal tip question - for multiple data entries
                    user28222

                    Hi planteg,

                     

                    As is usually the case, I had a bug in my code.

                     

                    I made the rookie error of having two scripts handling the save button, one for clicking and one for pressing keys ('Enter' and 'Return'.)

                     

                    It now works!  Thanks.

                    • 7. Re: Portal tip question - for multiple data entries
                      user28222

                      Hi planteg,

                       

                      I just realized that the following answered my original question(assuming the solution I seek is using a single portal): "Note that the portal will not scroll in order to show the last line on the first displayed row"

                       

                      Thanks for that as well!

                      • 8. Re: Portal tip question - for multiple data entries
                        planteg

                        Glad you solved the issue !