Copy Invoice portal to another table.

Version 3

    Screen+Shot+2017-05-07+at+9.15.26+AM.png

     

    Hello all,

     

    The portal Line Items are linked to the Invoice table as you see above.

    The new table that I created are called Voided Invoices.

    I created a script that it copy entire invoice to the Voided Invoices table whenever the user is delete the invoice record.

    However, when it copies the data, it only copy the last row on the invoice, and other invoice details.

    Meaning it copied only one Line Item of the portal row.

     

    The script looks something like this:

    ............................................

    set variable: $serviceName; value: Line Items::Service Name

    set variable: $regularPrice; value: Line Items::RegularPrice

    set variable: $technician; value: Line Items: technician

    ......................

    Go to Layout: Voided Invoices

    set field: service name; value: $serviceName

    set field: regular price; value: $regularPrice

    set field: technician; value: $technician

    .............................................................

    go back to original layout.

     

    halt script

     

     

     

    What's the best way to do this?