I have written save method in helper. I am able to save record but toast message is not displaying.
Below is the save method.
saveAction.setCallback(this,function(response){
var accId = response.getReturnValue();
var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
"title": "Success!",
"message": "The record has been updated successfully."
});
if (response.getState() == "SUCCESS") {
if(accId.startsWith('001')){
window.location.href = "/"+accId;
}
else{
component.set("v.accError",accId);
component.set("v.isAccError",true);
}
}
});
toastEvent.fire();
$A.enqueueAction(saveAction);