Custom property cache that disappears when the page changes

Hi all, I have a question about what happens when a page changes that may help me to resolve a very persistent and annoying bug that I've been trying to resolve for about a week.

[background information]
I have a complex operator screen that allows them to report production. On that screen, there is a selector that allows an operator to select the station they are at and then they're given a list of serials.

The bug is that if I'm running an order at the same station simultaneously, the previous operation's info is still present somewhere* and the previous operation's info gets retrieved (which is already completed! the operator can't report production).

*The way that screen is set up, I have a lot of named queries that are returning values from a database. Most of those DB values are view or root container custom properties.
[end background information]

The reason I bring up what happens when a page changes is because the bug goes away if I browse to a different page and then go back to the operator page. To be clear, when I complete an order, navigate to another page, then navigate back to the operator page (and then select the station), I'm seeing the desired views and information. I'm assuming custom properties are cleared, at the very least, but when I go through and clear all the custom properties in use through a script, that bug still happens. I hate when I don't understand why something is happening and this is driving me up a wall :frowning:

Hi @YF129701,

I'm hoping to get a bit more info about this issue. Are you currently working with Vision or Perspective? If this is in Perspective, I was wondering if maybe system.perspective.refresh would help since you noted that navigating away and back helps.

https://docs.inductiveautomation.com/display/DOC81/system.perspective.refresh

1 Like

A few other notes here. (I noticed you tagged 'perspective' in your original topic.)

Data will load into a view when you first open the view, i.e. all the bindings fire, and the data is populated.

Depending on the binding type, it will either continue to receive new data (for tag bindings, for example) or may never fire again (for query bindings with polling turned off, for example).

In your case, you'll want to look at the data that isn't updating, see what is populating that data - a binding or a script - and then adjust it so it updates at whatever rate or time you think would be appropriate. If it's based on named queries, and you're using query bindings to get the values from those named queries into the view, then you could turn on polling on those queries. (Check your named query caching settings too.) If you want to go the more advanced route, you could alternatively do a system.perspective.refreshBinding() on the appropriate bindings based on when a new run starts too, rather than polling, which would create less traffic to the database than periodic polling.

1 Like