# Obscure visionOpenedWindow launches root container script can't import system

**URL:** <https://forum.inductiveautomation.com/t/obscure-visionopenedwindow-launches-root-container-script-cant-import-system/31581>\
**Category:** Ignition\
**Created:** [January 24, 2020, 2:03am UTC](https://forum.inductiveautomation.com/t/obscure-visionopenedwindow-launches-root-container-script-cant-import-system/31581 "2020-01-24T02:03:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![d3h637](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@d3h637](https://forum.inductiveautomation.com/u/d3h637)\
**Post date:** [January 24, 2020, 2:03am UTC](https://forum.inductiveautomation.com/t/obscure-visionopenedwindow-launches-root-container-script-cant-import-system/31581/1 "2020-01-24T02:03:10Z")

</div>

I have a root container script in a popup window that refreshes the values on the page from a database. The script works fine from a button on the page, but when I call it from visionOpenedWindow, it fails the first time the window is opened, but not after that. So, if I open it, error pops up, then I close it. Every time I open it after that, the script works fine. Below is the visionOpenedWindow script and root container script. The error that is returned is “common.script.Imm object has no attribute ‘db’”. Note that I also tried system.tag.readBlocking and had the same error (except ‘tag’ instead of ‘db’). I have a workaround by copying the root container script directly into the visionOpenedWindow script and it works fine. The only issue with that solution is that when I change the UpdateParameters script I’ll have to maintain the changes in two places.

visionOpenedWindow script:

system.gui.getParentWindow(event).getComponentForPath(‘Root Container’).UpdateParameters()

Root Container Script:

def UpdateParameters():  
import system  
Parameters = system.db.runQuery(“Select \* from Table”, “database”)

---

<div class="post-metadata">

**Author:** ![bpreston](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@bpreston](https://forum.inductiveautomation.com/u/bpreston)\
**Post date:** [January 24, 2020, 4:24pm UTC](https://forum.inductiveautomation.com/t/obscure-visionopenedwindow-launches-root-container-script-cant-import-system/31581/2 "2020-01-24T16:24:45Z")

</div>

Where you are running the script from visionOpenedWindow, does your updateParameters routine need any binding to of run before it can function? Personally I rarely use visionOpenedWindow because bindings don’t run until after it. I’d run it from your root container as a property change script. I believe the property change you would look for is componentRunning but you would wan to do a print to make sure that is right. Running it there your bindings will of loaded if you need any but it will only run when your window is first opened.

---

<div class="post-metadata">

**Author:** ![osolorzano](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/osolorzano/32/6432_2.png) [@osolorzano](https://forum.inductiveautomation.com/u/osolorzano)\
**Post date:** [January 24, 2020, 8:00pm UTC](https://forum.inductiveautomation.com/t/obscure-visionopenedwindow-launches-root-container-script-cant-import-system/31581/3 "2020-01-24T20:00:30Z")

</div>

This is actually a known bug that is being fixed as part of the 8.0.8 release and is already in the nightly builds if you’d like to test it out.

---

<div class="post-metadata">

**Author:** ![d3h637](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@d3h637](https://forum.inductiveautomation.com/u/d3h637)\
**Post date:** [January 27, 2020, 4:54pm UTC](https://forum.inductiveautomation.com/t/obscure-visionopenedwindow-launches-root-container-script-cant-import-system/31581/4 "2020-01-27T16:54:20Z")

</div>

Good to know this is being fixed. Any idea when 8.08 will be released? We’re going to be doing QA testing on the software soon, at which point I’ll have to lock down the versions until we do an upgrade.

---

<div class="post-metadata">

**Author:** ![osolorzano](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/osolorzano/32/6432_2.png) [@osolorzano](https://forum.inductiveautomation.com/u/osolorzano)\
**Post date:** [January 29, 2020, 4:54pm UTC](https://forum.inductiveautomation.com/t/obscure-visionopenedwindow-launches-root-container-script-cant-import-system/31581/5 "2020-01-29T16:54:57Z")

</div>

Since the RC was released on Monday, we’d target ~2 weeks from that to a regular release. So should be right in the middle of February.
