function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Daniele SerraDaniele Serra 

Close modal dialog VF when internal Lightning Component fires event close quick action

Hi everyone,
First of all i have a Lightning Component with associated an Application Light:Out. The App is inside a Visual Force page.

After click the quick action, a modal dialog shows my VisualForce.

In the controller of my Lightning Component at some point I fire this:
 

$A.get("e.force:closeQuickAction").fire();
But in the Visual force page, instead closing it, it shows this error:
This page has an error. You might just need to refresh it.
Error in $A.getCallback() [Cannot read property 'fire' of undefined]
Callback failed: apex://NextStepControllerLightning/ACTION$nextStepConfigurarion
Failing descriptor: {c:NextStepLightning}

This error doesn't show when i click on a quick action linked directly to the Lightning Component.
My goal is to close this modal dialog or instead manage the variables inside the controller of the component using function javascript inside my visual force. 

Thank you for help.
 
NagendraNagendra (Salesforce Developers) 
Hi Serra,

May I suggest you please check with below link from the stack exchange community with a similar issue which might help. Please let us know if this helps.

Thanks,
Nagendra
 
Daniele SerraDaniele Serra
It can't help me. I am already use this 
$A.get("e.force:closeQuickAction").fire();

In the Lightning component. But this $A is not defined inside the App. I need a way to let comunicate App and Component. 
M.sfM.sf
Daniele Serra
Did you get any solution?We have the same issue.
Manish BhatiManish Bhati
Wherever you call below statement:-
$A.get("e.force:closeQuickAction").fire();

Ensure you are passing component as parameter to the function, then it will serve it purpose.