# Is it possible to bypass the shutdown event script of a perspective view?

**URL:** <https://forum.inductiveautomation.com/t/is-it-possible-to-bypass-the-shutdown-event-script-of-a-perspective-view/74320>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [May 30, 2023, 8:37pm UTC](https://forum.inductiveautomation.com/t/is-it-possible-to-bypass-the-shutdown-event-script-of-a-perspective-view/74320 "2023-05-30T20:37:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AVG04](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@AVG04](https://forum.inductiveautomation.com/u/AVG04)\
**Post date:** [May 30, 2023, 8:37pm UTC](https://forum.inductiveautomation.com/t/is-it-possible-to-bypass-the-shutdown-event-script-of-a-perspective-view/74320/1 "2023-05-30T20:37:22Z")

</div>

Here is my current setup:

- I have a perspective view with an onShutdown System Events that is enabled (script)
- the script function is to check if there are irregularities found on the view data. (this will be triggered when navigating to another screen)
- if there are irregularities, a popup will be displayed stating the irregularity.
- the popup is displayed but the view changed to the selected screen.

What I want to do:

- retain the current view while the script is executed. only move to the selected screen when the script found no issues.

- please give me pointers on how to retain the current view while executing the script.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 30, 2023, 8:51pm UTC](https://forum.inductiveautomation.com/t/is-it-possible-to-bypass-the-shutdown-event-script-of-a-perspective-view/74320/2 "2023-05-30T20:51:22Z")

</div>

It is almost impossible to prevent a browser from navigating wherever a user wishes to go. Security can block access upon arrival at a particular page, but security cannot stop a user from _leaving_ a page. If you have incomplete conditions in a session, your only _ **reliable** _ option will be to disable the components on other screens that need those conditions satisfied, while displaying a banner (in a dock, perhaps) that indicates the problem. (And presumably offers a button to navigate back to the incomplete page).

You might be able to minimize the problem by disabling all navigation on the problem page after editing begins, and making the condition-checking script perform the final navigation when the conditions are satisfied. Run that script from a button, not upon navigation.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [May 30, 2023, 9:13pm UTC](https://forum.inductiveautomation.com/t/is-it-possible-to-bypass-the-shutdown-event-script-of-a-perspective-view/74320/3 "2023-05-30T21:13:56Z")

</div>

Agreed. Your field validity check needs to occur BEFORE you allow a user the opportunity to navigate. Once you're in the shutdown script of a View there is no going back.

---

<div class="post-metadata">

**Author:** ![AVG04](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@AVG04](https://forum.inductiveautomation.com/u/AVG04)\
**Post date:** [May 31, 2023, 6:03am UTC](https://forum.inductiveautomation.com/t/is-it-possible-to-bypass-the-shutdown-event-script-of-a-perspective-view/74320/4 "2023-05-31T06:03:41Z")

</div>

Thanks for your inputs! I think I'll just either make the view to be a popup or remove all navigations on the view.
