-
How to override the redirect on saving force:createRecord in Salesforce Lightning?
I need to override the redirect on save of a force:createRecord lightning component.
var eve = $A.get("e.force:createRecord");
eve.setParams({
"entityApiName": "Opportunity",
"defaultFieldValues": {
"AccountId" : accountId
},
"panelOnDestroyCallback": function(event) {
console.log('test');
//console.log(event.getParam("id"));
var urlEvent = $A.get("e.force:navigateToURL");
urlEvent.setParams({
"url": "<some visualforce page url>",
"isredirect": "true"
});
urlEvent.fire();
}
});
eve.fire();
Log In to reply.
Popular Salesforce Blogs

Introduction to the Scratch Org | All You Need to Know
Scratch org is a deployment of Salesforce code and information that is source-driven and disposable. Since scratch org is completely customizable, developers can simulate several…

Step-By-Step Enhancement of Salesforce Contract Management
To maintain long-term business relations with customers, suppliers and partners, in particular, a company should organize an efficient contract management process. As business relationship and…
Popular Salesforce Videos
What is Salesforce? What Does it Do?
Business is rapidly changing. In this digital age, everything and everyone is connected, which is changing the way we communicate with our consumers. Businesses nowadays…
How To Start A Career In Salesforce? | Video Tutorial
Planning to start a career in Salesforce? Wondering where to head and learn. Watch this video and join this useful group for Salesforce job &…
Salesforce Acquires Slack
When Salesforce bought Slack earlier this week for $27.7 billion, it was in some ways the end of a startup fairytale. Slack was the living…