4 Replies Latest reply on Jun 23, 2012 6:36 PM by ziceg

    How to add a new line/record onto a portal table

    ziceg

      I have a window (Consignment) with a portal with a table (PartNos) that has hundreds of lines, how can I create a new line in that table without having to scroll down to last line. If I put a "plus" icon to create a new line and set it up as a button, what exactly do I need to tell the script to do? Because if I just say "New Record/Request" it will create a new record in the main window's table (Consignment) as opposed to the portal table (PartNos). What am I doing wrong?

       

      I read somewhere else another option that could be useful for my case, but not sure how to achive this.... "

      * new "blank" records can be made to appear at the top of the portal, instead of at the bottom (useful if there are more related record than the portal can display in its window and/or if the related records are sorted in

      descending chronological order)"

       

       

      Thanks

        • 1. Re: How to add a new line/record onto a portal table
          ziceg

          Well the way I've kind of managed to get it to work is by creating a second identical portal (with all fields identical) that I have placed above my proper portal, but this one is just a one line portal and set it to Filter portal record and used IsEmpty (field) then on that portal also included an icon to Commit record.

           

          At least it works for me for the moment

          • 2. Re: How to add a new line/record onto a portal table
            erolst

            Sort your original portal by creation timestamp descending (you need to have/define a timestamp field in your related table with auto-entry of creation timestamp), then use a button/script to generate a new child record, which automatically sorts to the top.

             

            This script needs to set a variable to the primary key of the parent table (assuming that is the match key for the relationship), go to any TO of the child table from the portal, create a new record, use Set Field (e.g. Set Field [ myRelatedTable::myForeignKey ; $myVariable ] to set the foreign key field, commit the new record, then return to the original layout.

             

            For streamlining your workflow, you could add Go to Object [ myPortalName ], Go to Portal Row [ First ], Go to Field [ portal field ]. You must give the portal a name in the Inspector for this to work.

             

            HTH

            • 3. Re: How to add a new line/record onto a portal table
              Mike_Mitchell

              I'm simple-minded. I just create a button that runs a script like this:

               

              Go to Field [ (related field ) ]

              Go to Portal Row [ Last ]

              Go to Field [ (related field ) ]

               

              Sure, the new record still appears at the bottom, but it's an easy way to get there. Just another option.

               

              Mike

              • 4. Re: How to add a new line/record onto a portal table
                ziceg

                Thank you that is a very simple and neat solution