+ Start a Discussion

Custom clone button

I'm trying to create a custom clone button on opportunity that will clone the current opportunity and populate the current opportunity id in a lookup field on the new opportunity. Then if Opp2 is cloned, the id for Opp2 should populate in the lookup field on the new Opp3.


It works great when the original opportunity is cloned.  However, when I clone the 2nd Opportunity (Opp2) and create Opp3, the lookup field on Opp3 shows the original Opportunity, instead of Opp2.  I cannot figure out why it's doing this.  Any ideas how I can fix?


Opp1 - Clone to create Opp2 (lookup should show Opp1)

Opp2 - Clone to create Opp3 (lookup should show Opp2, but shows Opp1)


Here's my button code.  Can anyone see what I'm doing wrong?




Ok I've figured out what is going on with this, but still can't find a solution to correct the issue.


When I clone the 1st opp to create Opp2, the Previous_Version__c field is populated with Opp1.  When I clone Opp2 to create Opp3, the button should update the Previous_Version__c field with the id of Opp2.  Instead, it is simply carrying over the previous value with was Opp1.  It's basically just cloning the field, instead of updating it even though I specified a new value in my button.


How can I get this field to actually update instead of just cloning the previous value?


I think it should be sufficent..............