Does anyone know how to remove the standard modal from the quick action ?
I tried to put that line in the init method but with no success:
$A.get("e.force:closeQuickAction").fire();
Any idea?
My Controller:
({
doInit : function(component, event, helper) {
$A.get("e.force:closeQuickAction").fire();
var action = component.get("c.getRecordTypeId");
action.setParams({
accountId : component.get("v.recordId")
});
action.setCallback(this, function(response){
var state = response.getState();
if(state === "SUCCESS"){
var recordTypeId = response.getReturnValue();
var createRecordEvent = $A.get("e.force:createRecord");
createRecordEvent.setParams({
"entityApiName": "Opportunity",
"recordTypeId" : recordTypeId,
"defaultFieldValues": {
'AccountId' : component.get("v.recordId")
}
});
createRecordEvent.fire();
} else if(state === "ERROR"){
console.log('Error: ' + JSON.stringify(response.error));
} else {
console.log('Unknown problem, state: '+ state + ', error: ' + JSON.stringify(response.error));
}
});
$A.enqueueAction(action);
}
})
Best Answer
What you all need is implement one interface in component i.e. force:lightningQuickActionWithoutHeader.
When used as actions, components that implement the force:lightningQuickAction interface display in a panel with standard action controls, such as a Cancel button. These components can also display and implement their own controls but should be prepared for events from the standard controls.
And in your controller, you can use this var dismissActionPanel = $A.get("e.force:closeQuickAction"); dismissActionPanel.fire();
Note:-
Reference:-
Update:-
try this:- you were using $A.get("e.force:closeQuickAction") not on the right place
Helper class:-