Need to override the redirect on cancel of a force:createRecord lightning component. - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Himanshu SharmaHimanshu Sharma 

Need to override the redirect on cancel of a force:createRecord lightning component.

Hello,
Need to override the redirect on cancel of a force:createRecord lightning component. im doing this but this isnt working for me...

({
    doInit: function (component, event, helper) {
        var LOOKUP = 'MRU_LIST&backgroundContext=%2Flightning%2Fo%2FContact%2Flist%3FfilterName%3DRecent'; 
        var createAcountContactEvent = $A.get("e.force:createRecord");
        createAcountContactEvent.setParams({
            "entityApiName": "Contact",
            "defaultFieldValues": {
                'Phone' : '415-240-6590',
                'FirstName' : 'Himanshu',
                'LastName' : 'Sharma',
                'Description' : 'Hello how are you..??',
            },
               "navigationLocation":"LOOKUP",
              "panelOnDestroyCallback": function(event) {
                window.location.href = "https://www.google.com";
            },
        });
        createAcountContactEvent.fire();
    }
})

Any help will be appreciated thanks in advance.
Best Answer chosen by Himanshu Sharma
Jayson MoralesJayson Morales
Hi Himanshu

Sorry for the inconvenience. In case you don't receive a response here, may I also suggest joining the Lightning Components Development group below to collaborate with the experts for best practice and advice.

https://success.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F930000000PbJaCAK

Hope that helps.

Regards,
Jayson

All Answers

Jayson MoralesJayson Morales
Hi Himanshu

Sorry for the inconvenience. In case you don't receive a response here, may I also suggest joining the Lightning Components Development group below to collaborate with the experts for best practice and advice.

https://success.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F930000000PbJaCAK

Hope that helps.

Regards,
Jayson
This was selected as the best answer
Himanshu SharmaHimanshu Sharma
Thanks Jayson