# System.Perspective function use within Project Scripts

**URL:** <https://forum.inductiveautomation.com/t/system-perspective-function-use-within-project-scripts/54609>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [January 3, 2022, 6:11pm UTC](https://forum.inductiveautomation.com/t/system-perspective-function-use-within-project-scripts/54609 "2022-01-03T18:11:03Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 3, 2022, 7:04pm UTC](https://forum.inductiveautomation.com/t/system-perspective-function-use-within-project-scripts/54609/6 "2022-01-03T19:04:27Z")

</div>

You’re probably going to have to restructure things a bit.

Basically, once you’re in a tag event script (as in, configured specifically on a tag, rather than a tag _change_ script), you’ve “lost” the context of the Vision or Perspective window/view you were in.

I would recommend a somewhat different pattern.  
Instead of writing to the tag, and _then_ checking for some error condition, you should have your ‘validation’ logic in the project library, and have your barcode scan/text box simply invoke that shared project script. You can use the technique(s) described in [this thread](https://forum.inductiveautomation.com/t/a-universal-way-to-alert-devleopers-about-errors/34914) to throw a generic error back to either context.

That way you can ‘guarantee’ whatever value makes it onto the tag is validated, and simplify the logic in your tag event script (I would also recommend putting _that_ code into a project script, as a general practice).

---

_[View the full topic](https://forum.inductiveautomation.com/t/system-perspective-function-use-within-project-scripts/54609)._
