Created a aura component and have overrided this component with NEW standard button .
On click of save, record gets created and redirect happens successfully.
The problem is, while clicking the cancel button the page is not redirecting back to the standard list view page.
Below is my sample code. I have also tried all the various ways of destroying the component and redirecting to the list view but have not been sucessfull in redirecting back.
Any suggestions in this regard is highly appreciated.
var createAcountContactEvent = $A.get("e.force:createRecord");
createAcountContactEvent.setParams({
"entityApiName": "Pipeline__c",
recordTypeId: recordTypeId,
"navigationLocation":"LOOKUP",
"panelOnDestroyCallback": function(event) {
var urlEvent = $A.get("e.force:navigateToURL");
urlEvent.setParams({
"url": "/lightning/o/Pipeline__c/home",
"isredirect":true
});
urlEvent.fire();
}
});
createAcountContactEvent.fire();
Thank you!!!
Best Answer
Found this sample code while referring to the following ideas
https://success.salesforce.com/ideaView?id=0873A0000003VnmQAE
https://success.salesforce.com/ideaView?id=0873A000000CSXWQA4
Unsure if this will help but you can try something like this
Also, Does panelOnDestroyCallback work for you?
Anudeep