+ Start a Discussion

Custom Clone Button that also updates original record?

Good morning,

I'm needing a custom clone functionality and can't figure out how to do it.


I want a button that will update the current opportunity (field Previous_Version__c=True), then clone it with Previous_Version__c=False.  I've figured out the cloning part, but is it possible to have the button update the current record before it clones it?


Thanks so much!

Ankit AroraAnkit Arora

Am not sure where is your button exactly, is it on native page or custom page?


If native page, then on button click you can execute the JS and update the present records with the value true and then call your logic for cloning.


If it is a custom page then I think it will be more easy as before cloning the record you can update the present record via apex.



Ankit Arora

Blog | Facebook | Blog Page


clone a record uisng textfield if i fill any number in the textfield as per the basis the records are cloned in same object..... uisng triggers afterinsert..