Currently, the cloning of an opportunity does not clone the contact roles associated with the opportunity.
Usually, organization create a number of opportunities with identical or similar contact roles. We often create “template opportunities” which contain the common re-usable data which saves us a lot of time re-keying information for similar opportunities. The addition of the cloning of the contact roles associated with an opportunity would be tremendously helpful, as these contact roles are often forgotten in the cloning and update process of the new opportunity.
Here is the salesforce Idea: https://success.salesforce.com/ideaView?id=08730000000BqJYAA0.
I just came up with real quick solution as below:
Create a custom clone button:
Goto Setup –> Opportunities –> Buttons, Links, and Actions –> New Button Detail Button:
/{!Opportunity.Id}/e?clone=1&retURL=%2F{!Opportunity.Id}&opp5="Existing Business"&
opp9={!TODAY()+30}&
opp11=Placeholder
&
cloneli=1
&saveURL=/apex/CloneContactRoles?oldId={!Opportunity.Id}
- We are passing different parameters in url to change the value of corresponding fields for new Opportunity. Please add/remove field mapping by adding/removing them in parameter.
- We are redirecting to Visualforce page that would create contact roles under the new Opportunity