Here I have created a custom detail button(New Contact) on Account object with some pre-populated Contact field values from Account record using Lightning URL Hacking.
Go to setup | Object Manager | Account | Buttons, Links, and Actions | Create a new Button
{!REQUIRESCRIPT("/soap/ajax/32.0/connection.js")}
var result = sforce.connection.query("SELECT Id FROM PermissionSetAssignment WHERE PermissionSet.Name = 'Sample_Permission_Set' AND AssigneeId = '{!$User.Id}'");
var psAssignment = result.getArray("records");
if (psAssignment.length === 1) {
//Write your logic
} else {
alert('You don't have access to this feature.');
}
Salesforce provides Clone functionality for some standard objects(Standard Clone button), However some standard objects do not have this button. For this purpose of cloning we will need to create custom button that will perform the functionality of cloning.
This cloning functionality can be achieved by writing a javascript for this custom button.
As an example lets create a custom button “Clone” on Account object that will clone the record.
Simply override your custom button “Clone” with the following javascript and you will have your custom Clone button that functions exactly like standard clone button