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.

  • You are calling this method from Visualforce page and not lightning right? – Pranay Jaiswal Dec 3 '18 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 Dec 3 '18 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 Dec 4 '18 at 5:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.