Script to Copy or duplicate data from Portal Row
I have a table call "Job orders" and other called "Quotes". The two tables take data from "Clients" (from a table called "Clients Billing") and "Products" (from a table called "line items")
Line items is used on a portal row.
I need to create a script that could copy or duplicate some field from "Quotes" into "Job Orders"
Right now, I can select a "quote" and create a new "job Order". All the Information from "Clients" is copied properly but the data that is in the portal row is not copied.
Please see below the relations and the script. I know that i have to create a loop but not sure how.
Any help will be great.