4 Replies Latest reply on Jul 21, 2016 11:18 AM by beverly

    How do i duplicate an entire invoice???


      we currently have a duplicate record button and it duplicates the record but will not duplicate any other information in the invoice. Like the labor and materials that were added. How do I make the script to create a duplicate button that will duplicate everything within that invoice??


      Please reply to me like you are talking to a dummie because everything I know about filemaker I have taught myself so I have no training. I just need to figure this out ASAP




        • 1. Re: How do i duplicate an entire invoice???

          Hi Kristina,


          I guess that the lines for an invoice are records in a related table, is that right ? If for example you have:


          Invoices <---------> Lines related by Invoices::Number


          You need to duplicate the record of the specific invoice as well as all the related records in Lines. Does that makes sense ?

          • 2. Re: How do i duplicate an entire invoice???

            planteg gave you the big answer of having to duplicate the invoice record as well as all of the related items table probably by a looping script.  But another question is identifying what you don't want duplicated such as invoice date or invoice number. 

            • 3. Re: How do i duplicate an entire invoice???

              Thank you Planteg!


              So for example we create an invcoice that has all of the labor and materials plus the cost, i want to create a button with a script to duplicate that entire invoice. Right now it just duplicates the record info like name, address, etc..I want it to duplicate all the materials and labor that I have added as well.


              I guess i can modify that button to duplicate everything but I don't know how to script it.

              does this look right??


              Create duplicate invoice

              Store primary key in a variable

              Go back to original invoice

              Go to related records from Invoice to related details.

              Loop through records

              Duplicate and use variable to set foreign key in new record.


              Do this for each group of related records.

              • 4. Re: How do i duplicate an entire invoice???

                You may wish to search for 'duplicate related' on this forum.

                1 of 1 people found this helpful