The requirement is to redirect to home page on saving a new To Do record . I have a lightning component with custom button added to Home page that onclick I am creating a new record using force:createrecord . The functionality is working fine, but on saving the record it is redirecting to created record detail page.Is there any way we can redirect to the source page where the button is clicked?

    <aura:component implements="flexipage:availableForAllPageTypes" access="global" >
   <lightning:button onclick="{!c.createtask}" iconName="utility:task" iconPosition="left" label="New To Do " />&nbsp;&nbsp;

    createtask : function (component, event, helper) {
    var createRecordEvent = $A.get("e.force:createRecord");
        "entityApiName": "Task"
  • One way i can think of is to call sever side controller and do your sabe there instead of force:createrecord, on success state call the navigatetosobject/navigatetourl method
    – Rao
    Commented Oct 11, 2017 at 2:32
  • As per the docs , there is no supported hooks for force:createRecord event with which you can redirect. So i guess you will have to build your custom component for granular control.
    – Sumuga
    Commented Oct 11, 2017 at 9:43


You must log in to answer this question.

Browse other questions tagged .