One of SObject Lightning pages contains an Action Button which opens a custom Visualforce page. I used javascript to open and close the dialog box. It works fine in classic but in lightning it won't close. So far I've tried:
window.close()
,
window.top.close()
,
window.self.close()
,
$A.get("e.force:closeQuickAction").fire();
and
window.top.location.href="/{!$CurrentPage.parameters.id}"
- none of these worked.
So far, an option closest to the solution was usage of window.top.location.href="/{!$CurrentPage.parameters.id}"
but it refreshes the whole window.
I was hoping the $A.get("e.force:closeQuickAction").fire();
but it didn't work either.
Even i tried Sfdc.canvas.publisher.publish({ name: "publisher.close", payload:{ refresh: "true" }});
too.