# Best way to check from one window when another window is closed

**URL:** <https://forum.inductiveautomation.com/t/best-way-to-check-from-one-window-when-another-window-is-closed/34716>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [May 13, 2020, 7:40pm UTC](https://forum.inductiveautomation.com/t/best-way-to-check-from-one-window-when-another-window-is-closed/34716 "2020-05-13T19:40:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pandreoli](https://avatars.discourse-cdn.com/v4/letter/p/94ad74/32.png) [@pandreoli](https://forum.inductiveautomation.com/u/pandreoli)\
**Post date:** [May 13, 2020, 7:40pm UTC](https://forum.inductiveautomation.com/t/best-way-to-check-from-one-window-when-another-window-is-closed/34716/1 "2020-05-13T19:40:54Z")

</div>

I have a window for viewing inventory item details. Not all this information gets updated often, so the bindings on fields dont need to be polled. Occasionally some fields do get edited, so I have a separate window for altering this information. For this I will use quantity as an example.

I have a separate window for editing quantity, you get this window by double clicking the quantity field on the viewing window. After the new quantity is submitted to the DB by this editing window it gets closed. The viewing window now needs its quantity binding refreshed. Is these a good way of tracking when this editing window is opened/closed so I can keep binding refreshes to a minimum?

Thanks for any suggestions.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [May 13, 2020, 9:15pm UTC](https://forum.inductiveautomation.com/t/best-way-to-check-from-one-window-when-another-window-is-closed/34716/2 "2020-05-13T21:15:43Z")

</div>

~~I’m assuming that the main window data is coming from an SQL query?  
   
 If so, you could create a boolean client tag called something like ‘RefreshQuery’ and in your edit button script in your editing window, write the invert of the value of this client tag. Then, on your main window, include thus in your sql query where clause:  
 `WHERE {[Client]RefreshQuery} = {[Client]RefreshQuery}`~~

~~This will force the query to update whenever the client tag changes value  
 ~~

Edit: yeah, that method has always been a bit clunky. Go with @pturmel 's refresh call.  
e.g.

```auto
window = system.gui.getWindow("Window/Path")
system.db.refresh(window.rootContainer.getComponent("Table"), "data")

```

---

<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 13, 2020, 9:46pm UTC](https://forum.inductiveautomation.com/t/best-way-to-check-from-one-window-when-another-window-is-closed/34716/3 "2020-05-13T21:46:05Z")

</div>

Consider including a call to system.db.refresh() in your script that saves from the edit window. Point it at the correct property in your viewing window.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [May 14, 2020, 9:04pm UTC](https://forum.inductiveautomation.com/t/best-way-to-check-from-one-window-when-another-window-is-closed/34716/4 "2020-05-14T21:04:59Z")

</div>

Sorry for stealing your solution, Phil @pturmel!  
🥺

---

<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 15, 2020, 12:03am UTC](https://forum.inductiveautomation.com/t/best-way-to-check-from-one-window-when-another-window-is-closed/34716/5 "2020-05-15T00:03:38Z")

</div>

No worries. You actually wrote it out for @pandreoli, so not unjust. (:
