Refresh lightning:recordEditForm After Save

There is no standard functions to refresh lightning:recordEditForm after save record. You can use aura:if to re-render the field section inside record edit form, after successfully saved the record.

Lightning Component:

<aura:component implements="flexipage:availableForAllPageTypes,force:appHostable">
    <aura:attribute name="reloadForm" type="boolean" default="true" />
    <!--Component Start-->
    <div class="slds-m-around_xx-large">
        <lightning:recordEditForm objectApiName="Account"
            <lightning:messages />
            <aura:if isTrue="{!v.reloadForm}">
                <lightning:inputField fieldName="Name"/>
                <lightning:inputField fieldName="AccountNumber"/>
                <lightning:inputField fieldName="Industry"/>
                <lightning:inputField fieldName="Phone" />
                <lightning:inputField fieldName="Website" />
                <aura:set attribute="else">
            <lightning:button variant="brand" type="submit" name="save" label="Save" />
    <!--Component End-->

Lightning JS Controller:

    handleOnLoad : function(component, event, helper) {
    handleOnSubmit : function(component, event, helper) {
    handleOnSuccess : function(component, event, helper) {
         component.set("v.reloadForm", false);
        component.set("v.reloadForm", true);
    handleOnError : function(component, event, helper) {

  • Saurabh Singh

    worked like a charm 🙂

  • Hector Mota

    same here 🙁

  • vinod

    Refresh lightning:recordEditForm After Save it is not working bro it is not refreshing the component and it is not saving the record..

    • Use it in lightning record page or in quick action, it will work.

      • vinod

        yah i tried but not working