I have used the lightning:recordEditForm. On click of the save button, the onsubmit function is not called.
If the submit function is called on the button onclick, then the record gets saved, but the onsuccess function is not called.
Component:
<lightning:recordEditForm aura:id="recordEditForm"
recordId="!v.selectedConfigId}"
objectApiName="Priority_Points_Settings__c"
onsubmit="{!c.onEditRecordSubmit}"
onsuccess="{!c.onRecordSuccess}">
<lightning:messages />
<div class="slds-col slds-size_1-of-2">
<!-- lightning:inputField components here -->
</div>
</lightning:recordEditForm>
<lightning:button variant="brand" label="Save" type="submit"/>
Controller:
onEditRecordSubmit : function(component, event, helper) {
event.preventDefault();
component.find('recordEditForm').submit();
},
onRecordSuccess : function(component, event, helper) {
console.log('>>In success');
}