4 Replies Latest reply on Nov 19, 2008 9:09 PM by shaulni

    Adding new record in a portal not as the last record

    shaulni

      Title

      Adding new record in a portal not as the last record

      Post

      I would like to be able to add a new record line in a portal IE (sale invoice) in the next row and not as the default last record. 

        • 1. Re: Adding new record in a portal not as the last record
          markstar
            

          Hi Shaulni,

           

          As you see, FileMaker only allows you to add new portal rows by clicking in the last row.

           

          One simple way to make this easier is be to add a button that calls the script step "Go to Portal Row [Last]" (with "Select entire contents" unchecked). This will put the cursor in the first field of the last row.

           

          There are other ways to do this that involve sorting the portal in descending order and using a script to create the child record in a way that pushes the new record to the top of the portal.

           

          Hope that helps -- Mark Conrad aka markstar

          • 2. Re: Adding new record in a portal not as the last record
            shaulni
              

            I am not sure I Made myself clear.

            what I would like to be able to do is

            let say I have an Invoice with 10 Rows all filled up but I want to add an Item after the 5th line, can I do it and do you have a sample of a script that could work?

             

            Thanks in advance

             

            SahulNI

            • 3. Re: Adding new record in a portal not as the last record
              davidhead
                

              OK so what you want to do is to specify the order of the portal rows. As you may know, portal records are displayed by default in order of creation. To modify the order of related records, you can apply a sort order to either the relationship or to the portal.

               

              So the next question is what field to sort by. You will need a field in your invoice item records for portal sort order. This can be a simple number field. If the user has access to that field, they can enter values for each portal record and thus affect the sort order.

               

              The neatest implementation of this is to have the process scripted so that the user does not see the sort order field but just clicks a button to move a row up or down.

              • 4. Re: Adding new record in a portal not as the last record
                shaulni
                  

                ok Thanks

                I will number the portal rows and than the user can change the numbers according to the order they want, and click sort button.

                 

                If you have a script example of doing it all by a click of a button I will be gratefull.

                 

                thanks a lot