Close popup on page Change

I am currently designing a project where I have a popup opening only on a specific page. I want to be able to close the popup when navigating away from this specific page. The user cannot close the popup manually and must follow the prompts in order to clear it under normal operation, however if they navigate off the page the popup should disappear.

I can open the popup but can't seem to find a valid way to trigger the popup close.

Has anyone successfully implemented a similar system? or have any ideas how I could achieve this?

Thank you in advance!

Is this vision or perspective? Add the relevant tag to this post to make it easier people to help with your question.

Assuming perspective, you can configure an onShutdown event and run system.perspective.closePopup('') which will close the last popup that was in focus.

1 Like

Hi Amy, thanks for the quick response. I am using perspective, tags updated.
Appreciate the nudge got it working now! I thought I tried that earlier but must have been missing something. Much easier than what I was preparing to write. Thanks

One more note to add.
Originally I used the Popup Action > Close with a defined page id.
This did not work correctly.

Replacing the standard action with a script version worked perfectly.

I thought these two methods were essentially the same, one with a nice GUI. Obviously not.