5

I want to use the standard layout for creating and editing records within my lightning component.

I don't want the user to leave the page that he is in (one page application...)

So I want to implement a popup for editing and creating these records, I am trying to use$A.get("e.force:editRecord"):

editRecord: function(component, event, helper) {
    var recordId = component.get("v.id");

    var editRecordEvent = $A.get("e.force:editRecord");
    editRecordEvent.setParams({
        "recordId": recordId
    });
    editRecordEvent.fire();
},

The problem that I encounter is that after the user clicks on the Save button in the popup, the page is redirected to the record that was edited or created.

I cannot find a way to cancel this redirection. This question asks how to capture the save event. Although it is related to my problem, it not the same and there is no solution there.

So can I cancel the redirection after saving?

2

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.

  • Thanks @FabienTailon - I have given up on this long time ago, and it is still not possible... – Itai Shmida Nov 15 '17 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.