Loading

Create Lightning Custom button to clone and edit the newly created record

Publiseringsdato: Dec 14, 2025
Beskrivelse
In classic, the requirement of cloning record via custom button and to perform edit operation to various fields on the cloned version is achieved by listing the ID of the fields to edit and the new values in the button's URL. 

For Lightning, currently there's no out of the box functionality available.
Løsning

There is no direct out of box functionality to do this using custom button and quick actions. You can use the example process outlined below to achieve the same in Lightning via customization.

1. Create a Lightning component that will open any record that one wishes to clone. Make use of force:hasRecordId interface. This enables the component to be assigned the ID of the current record. 
2. In the controller part, the force:hasRecordId interface will provide the id to clone the record and one can create business logic to make necessary changes in values accordingly.
3. The changed values can be displayed in a view/screen or modal pop up, along with save & cancel button.
4. Use that Lightning component to be called on the click of a "Quick Action".


For additional information, we also suggest reviewing the Trailhead about making the component context aware.

 

Knowledge-artikkelnummer

000384654

 
Laster
Salesforce Help | Article