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 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.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

venkatsforcevenkatsforce

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..