I have a similar code as below.
createRecord : function (component) {
var createRecordEvent = $A.get("e.force:createRecord");
createRecordEvent.setParams({
"entityApiName": "Case",
"panelOnDestroyCallback": function(event) {
$A.get("e.force:navigateToSObject").setParams({
recordId: component.get("v.recordId"),
slideDevName: "detail"
}).fire();
}
});
createRecordEvent.fire();
}
It does not redirect to the record id i have provided and this code is not even calling the function inside "panelOnDestroyCallback".
I have also tried "navigationLocation": "LOOKUP" and I do know RELATED_LIST opens the same page i have called the createrecordevent.
I have also tried url redirect too inside that "panelOnDestroyCallback".
panelOnDestroyCallback is not even getting called in the code.
My intention is to send the page to account record detail page after it saved the case record which was opened from createrecordevent??
e.force:createRecord
will automatically redirect you to the new record after creation. No need to define a custom callback for that.