# Trigger namedquery on other object

**URL:** <https://forum.inductiveautomation.com/t/trigger-namedquery-on-other-object/95008>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [August 22, 2024, 11:41am UTC](https://forum.inductiveautomation.com/t/trigger-namedquery-on-other-object/95008 "2024-08-22T11:41:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eike\_H](https://avatars.discourse-cdn.com/v4/letter/e/b38774/32.png) [@Eike\_H](https://forum.inductiveautomation.com/u/Eike_H)\
**Post date:** [August 22, 2024, 11:41am UTC](https://forum.inductiveautomation.com/t/trigger-namedquery-on-other-object/95008/1 "2024-08-22T11:41:22Z")

</div>

Hi,

I am working on a perspective projet which is an log of shutdown times for different areas.  
Think of it like a 3 by x table where X is the number of different areas which have shutdown minutes.  
Visible is the current hour, the previous and the next.

I am using a multi state button to switch/scroll through the hours.

All inputs are saved into an sql databese via namequery.

Now users should be able to scroll through the hours and then read and maybe edit some values. For now I can only save data for the current hour.

What I am missing now is a way to trigger a namedquery as soon as the user is scrolling back to read those inputs.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [August 22, 2024, 12:23pm UTC](https://forum.inductiveautomation.com/t/trigger-namedquery-on-other-object/95008/2 "2024-08-22T12:23:59Z")

</div>

On the button's `onActionPerformed` event use [system.perspective.sendMessage | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-perspective/system-perspective-sendMessage) to wake up a message handler on the table. Have the message handler script run the line,  
`self.refreshBinding("props.data")`

> **[Perspective Component Methods | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/ignition-modules/perspective/scripting-in-perspective/perspective-component-methods#refreshing-bindings)**
>
> A component method is a function that is defined on a component object. For example, this is how we would call a component method defined on the component object self:

> **[Component Message Handlers | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/ignition-modules/perspective/scripting-in-perspective/component-message-handlers)**
>
> In Perspective, Component Message Handlers are the preferred way to pass parameters between components or Views. Doing this involves the system.perspective.sendMessage function. There are typically two steps involved:

---

<div class="post-metadata">

**Author:** ![Eike\_H](https://avatars.discourse-cdn.com/v4/letter/e/b38774/32.png) [@Eike\_H](https://forum.inductiveautomation.com/u/Eike_H)\
**Post date:** [August 27, 2024, 9:28am UTC](https://forum.inductiveautomation.com/t/trigger-namedquery-on-other-object/95008/3 "2024-08-27T09:28:44Z")

</div>

Thanks for the answer, it did help to some extend.

It wasnt 100% working so I made a small test field, where I now have a Multi-State-Button and a label where the text should change onActionPerformed. I can see that there is a delay or sometimes not even updating.

Is there a limitation like minimum time between messages?
