5 Replies Latest reply on Jun 7, 2014 1:05 AM by keywords

    New Portal Row Order

    mrosenhek

      OK, I used to create portal rows with a script/button, and sorted the portal in descending order (on primary key). The net result = the newest row becomes the first portal row. Much nicer for data entry. However I want to depart from the button method and simply have the users click in the portal to create a row. In FM, new rows are created at the bottom of the portal by design, but is there a way to overcome that without having the user click a button to add a row?

        • 1. Re: New Portal Row Order
          keywords

          No matter how the portal is sorted, a new blank row (if the relationship allows record creation) is always at the bottom of the portal.

          • 2. Re: New Portal Row Order
            erolst

            You could create two relationships: one with a TO that allows creation, the other one with a TO that does not.

             

            Use the one that does with a portal that only shows one row and has a filter condition like

             

            not portalTO::primaryKey

             

            Put that portal above a portal into the TO that doesn't allow creation. A newly created portal row, having received its PK automatically, no longer satisfies the filter condition and will on commit 'migrate' into the lower portal, being replaced by the spare row for the next entry.

             

            You need two TOs because the inverse filter condition doesn't work, i.e. a portal into an "allow creation" TO will always display its spare row which cannot be 'filtered away'.

            • 3. Re: New Portal Row Order
              mrosenhek

              Simple. Why didn't I think of that. I'll try that solution and see. I'm just trying to simplify my new FM13 template to have the least amont of anything. Less buttons, less code less everything. Minimalist that I am

              Thanks.

              • 4. Re: New Portal Row Order
                mrosenhek

                Ya, thanks but I thought I made it clear that I know that. Look at the solution that erolst provided. That is a workaround. Simple too.

                • 5. Re: New Portal Row Order
                  keywords

                  That is a really neat trick! Thanks erolst.