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
BrandiTBrandiT 

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?

 

/{!Opportunity.Id}/e?clone=1&retURL=%2F006S0000006odYS&CF00NS0000001D9ZZ__lkid={!Opportunity.Id}&CF00NS0000001D9ZZ={!Opportunity.Name}&00NS0000001D93x=0 

BrandiTBrandiT

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?

PrasadVRPrasadVR

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

/{!Opportunity.Id}/e?clone=1&retURL=%2F{!Opportunity.Id}.