I have and quotation system.
So I have this table structure.
I have added duplicated order feature so user can duplicated the order and order line item and assign to different customer.
I have used following method to duplicate order and order line items.
set variable $orderid
set variable $newid
Go to layout - child layout
set field childTable::parentID = $orderid
set variable $path - get(temporarypath) & "temp.fmp12"
export records to $path
import records from $path
replace field contents childTable::parentID with $newid
return to parent layout
The order and order line item do get duplicated perfectly fine.
But when I go on to the duplicated order and change the customer; it create new customer record.
I have a layout based on orders.
On the top of layout I have customer selection field. Than, below I have portal showing line item of quotes of that customer and order.
So When I duplicate record, go to the add line item layout and change the customer; it created new customer record and portal below becomes empty.
How I can resolve this.