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
RayAllenRayAllen 

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

Hello,

 

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?

Sonam_SFDCSonam_SFDC

Hi,

 

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

http://stackoverflow.com/questions/9289005/clone-an-opportunity-and-its-lineitems-programatically-in-salesforce

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

 

Worth giving a read...

DarrellDDarrellD

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?

 

Darrell