In order to achieve this functionality, you will need to do use an aura component which implements the force:hasRecordId and force:lightningQuickAction interfaces.
You will need to build the "Would you like to clone?" Yes/No part of the user interface within the aura component. When the user makes their selection, you must use the force:createRecord component (See Documentation here). If the user selects yes, then you will need to prompt them for record type selection, then set the default values from the current record. It might be wise to use a field set to determine which fields you want to clone.
Here is an example using the force:createRecord where you set default values:
var createAcountContactEvent = $A.get("e.force:createRecord");
createAcountContactEvent.setParams({
"entityApiName": "Contact",
"defaultFieldValues": {
'Phone' : '415-240-6590',
'AccountId' : '001xxxxxxxxxxxxxxx'
}
});
createAcountContactEvent.fire();
In order to fetch the record types, you must do something like this:
<lightning:radioGroup
name="radioGroup"
options="{! v.recordTypeOptions }"
value="{! v.selectedRecordTypeId }"
type="radio"/>
private static List<RadioOption> getRecordTypeValues(String objectName) {
list<RadioOption> returnValue = new List<RadioOption>();
List<Schema.RecordTypeInfo> recordtypes = Schema.getGlobalDescribe().get(objectName).getDescribe().getRecordTypeInfos();
for(RecordTypeInfo rt : recordtypes) {
if(rt.getName() != MASTER && rt.getName().trim() != '' && rt.isAvailable()) {
RadioOption option = new RadioOption();
option.value = rt.getRecordTypeId();
option.label = rt.getName();
returnValue.add(option);
}
}
return returnValue;
}
public class RadioOption {
@AuraEnabled
public String value {get; set;}
@AuraEnabled
public String label {get; set;}
}