2

So I had to override the new button on the case object with a lightning component. When clicking a button on this component I call the createRecord event which works great. And if they click submit it redirects to the newly created case which is also great. The problem is if they click cancel then it redirects back to my lightning component. I would like it to redirect to the case list view. Is there any way to do this? Here is the code for the event:

var createRecordEvent = $A.get("e.force:createRecord");
                createRecordEvent.setParams({
                    "entityApiName": "Case",
                    "recordTypeId": vars["recordTypeId"]
                });
                createRecordEvent.fire();

Perhaps there's a way that when the component gets focus again it automatically redirects? I know there is the init event maybe I can edit this to do the redirect if it is initialized twice? Or is there another default event that I could leverage?

Your Answer

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

Browse other questions tagged or ask your own question.