I built a lightning component to make some changes to Lead Record and I added it as a quick action.
This is my helper.js:
changeOwnerAction : function(cmp,event) {
var recordId = cmp.get("v.recordId");
var action = cmp.get("c.changeOwnerForSelectedRecord");
action.setParams({
recordId : recordId
});
action.setCallback(this,function(res){
var state = res.getState();
if(state === "SUCCESS"){
//do something
}
});
$A.enqueueAction(action);
},
closeAction: function(cmp, event){
var recordId = cmp.get("v.recordId");
var sObectEvent = $A.get("e.force:navigateToSObject");
sObectEvent .setParams({
"recordId": recordId,
"slideDevName": "detail"
});
sObectEvent.fire();
}
And the controller calls those functions one after another:
doInit : function(component, event, helper) {
helper.changeOwnerAction(component,event);
helper.closeAction(component,event);
}
The doInit is used in an handler:
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
At the end of the action the modal still shows for just a second but I've to wait few seconds to get the update available in the detail view as well as in the Lead state wizard.
has anyone else faced this issue?