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
Brad Nordling 9Brad Nordling 9 

How can I close a window that was opened from a lightning record page?

How do I close a window that was opened from a lightning record page?
I have a parent object whose lightning record page has a component for a child object related list.  I have created a custom button on the child object that opens a VF page for some bulk editing of child objects associtated with the parent.  When the button is clicked in the related list component, the page opens but I've tried twenty ways to close it in both the class and the VF page but nothing works.  I've read that a popup can't close itself, it must be closed by the window that opened it.  But that was the lightning record page of the parent object.  What's that best way to close the popup window other than telling the user to close the tab?
Best Answer chosen by Brad Nordling 9
Brad Nordling 9Brad Nordling 9
Did a redirect to parent using parent's saved Id and it worked.

All Answers

Suraj Tripathi 47Suraj Tripathi 47
Hi Brad Nordling 9

Greeting!

Try this in your code, it may help you.
 
var <variableName> = $A.get("e.force:closeQuickAction");
<variableName>.fire();


if you find your solution mark this as the best answer.

Thank you!

Regards,
Suraj Tripathi
Brad Nordling 9Brad Nordling 9
Suraj, thanks for the suggestion but this did not work.  Like the other things I've tried, the window remains open.
Brad Nordling 9Brad Nordling 9
Does anybody know the answer to this question?
Brad Nordling 9Brad Nordling 9
Did a redirect to parent using parent's saved Id and it worked.
This was selected as the best answer