4 Replies Latest reply on Mar 10, 2013 9:51 AM by fluffyone

    copy a portal row to a new portal row?

    fluffyone

      Title

      copy a portal row to a new portal row?

      Post

           hi group, I have a portal with a list of related records and i want to put a small button in it so that wehn it is pushed it would copy the last portal row as a new recored in the related records, or even better if it can copy the current selected / highlighted row.

            

           is this possible?

            

           regards Fluffy

        • 1. Re: copy a portal row to a new portal row?
          philmodjunk

               If you but the button in the portal row, clicking that button can duplicate that specific portal row:

               If [ Not IsEmpty ( PortalTable::_FkField ]--> check a field that always has a value for related records
                 Show Custom dialog ["duplicate this row?"]
                 IF [ Get ( LastMessageChoice ) = 1 // OK was clicked ]
                     Freeze Window
                     Go To Related Record [Show only related records; From table: PortalTable ; Using layout: "PortalTable" (PortalTable) ]
                     Duplicate Record/Request
                     Go to Layout [original layout]
                 End IF
               End IF

               The first If step is only needed if "allow creation...." is enabled for the portal.

               Also be careful of script triggers that may interfere with this script when it changes back and forth between layouts. While Freeze Window will keep the layout change from being visible to the user, the change in layouts can trip quite a few different triggers on either of the two layouts. There are ways to set a value in a global variable to keep trigger performed scripts from doing anything in order to keep them from interfering.

               The change in layouts will also cause a loss of the focus on a specific portal row. That is unlikely to be a problem here, but if it is, you can also capture the current portal row number in your script to use to reset the focus on that portal row by adding a few more steps to this script.

          • 2. Re: copy a portal row to a new portal row?
            fluffyone

                 Hi Phil

                 thankyou for your reply theres a few caviates in that solution and i don't want to disrupt other data acidently 8-/
                 I will try on a copy database file to make sure it doesn't cause issues first.

                 i am using filemaker pro10, do you know if the latest version has more functions in portals to simplify / strengthen this?

                 regards Fluffy

            • 3. Re: copy a portal row to a new portal row?
              philmodjunk

                   This seems pretty simple and secure to me. There are no new FileMaker 12 features that would change what I have recommended here.

              • 4. Re: copy a portal row to a new portal row?
                fluffyone

                     Thanks Phil

                     that works a treat! thank you again 8-)

                     regards Fluffy