3 Replies Latest reply on May 4, 2017 6:39 AM by philmodjunk

    Duplicate the child record and assign to different parent




      This is tricky question, i will do my best to explain.


      I have database tables, customers and orders.


      A portal is placed on the customer layout, which shows all the orders linked with a customer. (above picture).


      I have edit button which contain copy button. What I want to do is when I click on copy button, I can duplicate the clicked order; edit that order and assign to different customer.


      This popop button is placed on portal row. When I click on "copy", this pop up open.


      This pop will show the order details of clicked portal row.


      What I want to achieve is to be able to select customer, made changes to order if necessary and it would create new order for customer I selected.



      I have this script on order button. I managed to duplicate the clicked records and assign it selected customer. But the problem is If I amend any other order details, It would change the original order details since, the popover contain fields from the portal.


      How i can copy the original order from portal, than also it would allow me to amend any details and save as new order under right customer.

      Thank you.