I have a Clone With Product Button in classic using url hacking. it clones the order with all the products and opening the order editing page. the order and products will be saved when click save or return to origin order without saving anything on cancel.

I am trying to recreate exact same behavior in lightning. how should I do it? currently I am trying to create a visualforce page button. the controller is an extension of standard order controller, I have to create the order and lines and insert them into the database and then redirect to the editing page of the new order. I want to override the cancel button so when click cancel it will rollback the database to my savedpoint(delete the order). but it looks like the button override is not working in lightning.

so what is the lightning solution for this button?


Here you can find a solution for this problem.


You can write custom apex logic as per your requirement.
In javascript code call apex method you can achieve what you want.
**sforce.apex.execute **
please check below link.

protected by Community Jul 26 at 21:03

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.