I'm trying to catch the onsuccess event of a lightning:recordEditForm , because I need the Id of the record created. I'm not able to get that Id, how can I do that?

Thank you for your help. Below you'll find my code.


 <div class="slds-m-top_small">
                <lightning:recordEditForm aura:id="createContestForm" objectApiName="Case" recordTypeId="{!v.recordTypeId}" onsuccess="{!c.onSuccess}" onerror="{!c.onError}" onsubmit="{!c.onSubmit}">
                    <lightning:messages />

                        <lightning:inputField fieldName="Scope__c" value="Penale" />
                        <lightning:inputField fieldName="Type__c"  value="Contestazione"/>
                        <lightning:inputField fieldName="Subtype__c" value="{!v.casesubtype}" />
                        <lightning:inputField fieldName="Description" />
                        <div class="slds-align_absolute-center">
                            <lightning:button aura:id="submit" variant="brand" class="slds-m-top_small" type="submit" label="Create" />



// Intercept the sucess event
    onSuccess  : function(component, event, helper) {

        console.log('****onsuccess event****' , event);
        var params = event.getParams();


Just for clarify I see 'response***** undefined' inside the browser console.

  • 1
    Remember, javascript is case sensitive.
    – glls
    May 9 '18 at 13:42