2

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.

3
  • You are calling this method from Visualforce page and not lightning right? Commented Dec 3, 2018 at 14:24
  • Did you try the solution proposed here on a very similar question? Note that there's a script include line as well as the canvas call.
    – David Reed
    Commented Dec 3, 2018 at 15:24
  • Yes, i am calling this method from vf page. But according to my knowledge i am using javascript may be thats why it doesn't support in lightning. Is it...? But i don't want to write whole new lightning component for this so, please me out if there's any other solution. Thanks.
    – user46402
    Commented Dec 4, 2018 at 5:29

0

You must log in to answer this question.

Browse other questions tagged .