+ Start a Discussion

How to create a duplicate opportunity from previous when the opp stage is equal to a certain stage



I want to create a duplicate opportunity, for example, if opportunity stage is equal to “won” , I want it to be able to create an exact replica of the old opportunity.  I know I’ll have to make a workflow and use apex code. Also, I would want it to be fully automated.


How can I write the formula for this?




Got the following code which talks about cloning a given opportunity - sample code provided.


The filter is the one which is different - your SOQL query should fetch the opportunites that are closed WON.


Worth giving a read...


But are you using Visual Workflow, or Flow, for this? If not you will want to post this in a different Forum.


If you are using Flow then are you using it to create the original Opportunity?