Clone to Any SObject Record With Lightning Component

In this blog, I am going to show how to clone the record using lightning component quick action. The same functionality can be implemented by using even quick actions without having component also. But this component will be used to clone any object single record.

Step 1: Lightning Component 

Here is the complete code for the quick action.

Apex Class

Lightning Component

Step 2: Create a Quick Action

now create a new quick action as shown below

Step 3: Add the Action to the page layout

Now add the quick action to the page layout Salesforce Mobile and Lightning Experience Actions section. After adding the quick action, you can able to see them on the page layout.

Testing 

Now when you click on the Custom clone button it is going to clone the record.