Is there a way to use force:createRecord but capture the redirect to the newly created record page that occurs after saving the record? Finally, prevent the redirect from completing?

createRecord : function (component) {
    var createRecordEvent = $A.get("e.force:createRecord");
        "entityApiName": "Event__c"
  • I had the same question - it does not seem to have a solution, so I think this is not possible Nov 12, 2017 at 11:11

3 Answers 3


So instead of hacking the redirect with window.location.hash, you can use the following navigation method in the "panelOnDestroyCallback".

"panelOnDestroyCallback": function(event) {
                    recordId: component.get("v.recordId"),
                    slideDevName: "detail"

The page will navigate to the new record and then back so it is not the smoothest transition but it does work.


Just add "navigationLocation": "RELATED_LIST" to the list of params and you will stay on the page after saving.

  • "panelOnDestroyCallback" is not available on Mobile. Jan 26, 2021 at 4:38

There is an undocumented solution for this. Below is the js controller function that creates a new Contact record and redirects back from the record page to the initial page after a new record is created.

createNewContact: function(component, event, helper) {
    var windowHash = window.location.hash;
    var createEvent = $A.get("e.force:createRecord");
        "entityApiName": "Contact",
        "panelOnDestroyCallback": function(event) {
            window.location.hash = windowHash;

Where "panelOnDestroyCallback" is the hidden force:createRecord attribute. I know that's an ugly hack, but hey, if I had known this before I wouldn't have spent 50+ hours implementing a fully-custom multi-object 'createRecord' component with all the schema tricks, custom lookups, multipicklists etc.

  • There are chances that this won't redirect sometime. Jan 4, 2018 at 15:35
  • 1
    you're right, but that's always the story with SF... people find the way to make work under the risk of some future issues (e.g. Visualforce URL hacks which are unrecommended and not supported while still very useful) Jan 4, 2018 at 16:08
  • 1
    Does this solution even work? It didn't on my Community page where I have my custom component. It still redirects me to the new record's detail page. MEH!
    – Arnold Jr.
    Jan 26, 2018 at 19:52

I answered in the other thread, but to make it easier answering here too:

So far it's not possible.

If you have access to the Partner Community, I asked about this here but it was not on the roadmap for now.

An idea has been created recently for it, so I would suggest to go and vote for it here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .