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?

2 Answers 2


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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .