function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Marilyne PMarilyne P 

overriding a button Clone on opportunity

Hello,

I have below use case to execute.

I have a standard button on opportunity, to clone with and without products.
I want to add an option to this clone button. like do XYZ, if user chooses this XYZ, it will execute few actions. if they choose the standard options, it remains the same.

Thank you for suggestions !
Best Answer chosen by Marilyne P
Avishek Nanda 14Avishek Nanda 14
Hey  Marilyne,

You wouldn't be able to make any changes to the standard button. However, You can replicate the same functionality in a custom button with some additional logic to be processed.

Above Use Case :

What you can do you can have a custom button which will have two option. 1 Would be the replication of the standard functionality and other would be your logic what you want to do in here would be If User select XYZ.

Options can be controlled with a checkbox using a visualforce Page with screen pop up. Basically, When the user clicks on the custom button you will show the VF page which will have Two Option to choose from. Based on your User Selection your Controller will do the things. 

Let me know if this helps. 

All Answers

Avishek Nanda 14Avishek Nanda 14
Hey  Marilyne,

You wouldn't be able to make any changes to the standard button. However, You can replicate the same functionality in a custom button with some additional logic to be processed.

Above Use Case :

What you can do you can have a custom button which will have two option. 1 Would be the replication of the standard functionality and other would be your logic what you want to do in here would be If User select XYZ.

Options can be controlled with a checkbox using a visualforce Page with screen pop up. Basically, When the user clicks on the custom button you will show the VF page which will have Two Option to choose from. Based on your User Selection your Controller will do the things. 

Let me know if this helps. 
This was selected as the best answer
AmulAmul
you can use flow and Process Builder to clone the Record. and you can also call this flow through the button.